getGliders.php

Get all the gliders connected in the last 30 minutes within a spatial window.

Arguments

apikey (necessary)
API key: you can request a key by sending an email to contact@weglide.org
lat (necessary)
Latitude (float number)
lng (necessary)
Longitude
degree (necessary)
Window of query: all gliders will be within the interval [lat-degree;lat+degree] and [lng-degree;lng+degree]

Example: http://www.weglide.org/api/getGliders.php?lat=45.38&lng=4.57&degree=10

Android example:

		ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
		nameValuePairs.add(new BasicNameValuePair("lng", "" + longitude));
		nameValuePairs.add(new BasicNameValuePair("lat", "" + latitude));
		nameValuePairs.add(new BasicNameValuePair("degree", "" + degree));
                try {
			HttpClient httpclient = new DefaultHttpClient();
			HttpPost httppost = new HttpPost(
					"http://www.weglide.org/api/getGliders.php");
			httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
			HttpResponse response = httpclient.execute(httppost);
			HttpEntity entity = response.getEntity();
			is = entity.getContent();
			
		} catch (Exception e) {
		...
		}

Answer

This methods gets the position of the gliders in json format, with (cle, nickname, latitude, longitude, altitude, speed, state):

Example: [{"cle":"-1379711855-139202","nickname":"toto","latitude":"45.4443","longitude":"4.50718","altitude":"529","speed":"0","action":"1"}]

altitude is in meters

speed is in meters by second

action is a code, see update

Return values (error codes):

-1
the entry defined by 'cle' does not exist in the database
-2
the parameters could not be validated
-5
The generated sql query is invalid