• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
brendanashworth

brendanashworth

militaryplanes

Public
Like
1
militaryplanes
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://brendanashworth--7853124e839011f0a1870224a6c84d84.web.val.run
README.md

Milradar to GeoJSON Converter

A simple HTTP endpoint that fetches military aircraft data from milradar.com API and converts it to GeoJSON format.

Usage

Make a GET request to the /planes.geojson endpoint:

curl https://your-val-town-url/planes.geojson

Data Format

Input (Milradar API)

[ { "id": 8409, "plane_type_id": 1409, "lat": 47.611162, "lon": -68.5568, "gspeed": 433, "type": "C17", "callsign": "BRK81 ", "track": 199, "is_flying": true } ]

Output (GeoJSON)

{ "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 } } ] }

Key Transformations

  1. Coordinate System: Converts from lat, lon to GeoJSON [longitude, latitude] format
  2. Data Cleaning: Trims whitespace from callsigns
  3. Structure: Wraps individual points in GeoJSON Feature format
  4. Collection: Groups all features into a FeatureCollection

Response Headers

  • Content-Type: application/geo+json
  • Cache-Control: public, max-age=60 (1 minute cache)
  • Access-Control-Allow-Origin: * (CORS enabled)

Error Handling

Returns appropriate HTTP status codes:

  • 200 OK: Successful conversion
  • 500 Internal Server Error: Conversion failure (with error details in JSON response)
HTTP
  • main.tsx
    brendanashworth--78…84.web.val.run
Code
README.md
H
main.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.