A simple HTTP endpoint that fetches military aircraft data from milradar.com API and converts it to GeoJSON format.
Make a GET request to the /planes.geojson endpoint:
curl https://your-val-town-url/planes.geojson
[ { "id": 8409, "plane_type_id": 1409, "lat": 47.611162, "lon": -68.5568, "gspeed": 433, "type": "C17", "callsign": "BRK81 ", "track": 199, "is_flying": true } ]
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-68.5568, 47.611162] }, "properties": { "id": 8409, "plane_type_id": 1409, "gspeed": 433, "type": "C17", "callsign": "BRK81", "track": 199, "is_flying": true } } ] }
lat, lon to GeoJSON [longitude, latitude] formatContent-Type: application/geo+jsonCache-Control: public, max-age=60 (1 minute cache)Access-Control-Allow-Origin: * (CORS enabled)Returns appropriate HTTP status codes:
200 OK: Successful conversion500 Internal Server Error: Conversion failure (with error details in JSON response)