Overview
The helicopter data integration fetches real-time aircraft positions from ADS-B Exchange (adsb.lol) and filters for helicopters operating over New York City. The system polls every 12 seconds and displays up to 10 helicopters on the map.fetchHelicopters()
Fetches live helicopter positions within a 25 nautical mile radius of NYC.src/helicopters.ts
Returns
Returns aPromise<HelicopterState[]> containing up to 10 helicopters, sorted by altitude (lowest first).
Implementation Details
Search Parameters
src/helicopters.ts
ADS-B Exchange API Endpoint
The function uses a proximity-based API endpoint:src/helicopters.ts
https://api.adsb.lol/v2/lat/{lat}/lon/{lon}/dist/{dist} in production.
The
cache: 'no-store' option ensures fresh data on every poll. ADS-B data updates every 1-2 seconds from ground stations.Helicopter Type Filtering
Aircraft are filtered using ICAO type designators. TheHELI_TYPES set contains known helicopter models:
src/helicopters.ts
src/helicopters.ts
- Type code is in
HELI_TYPESOR starts with'H'(catches military variants) - Not on the ground (
alt_baro !== 'ground'and is numeric) - Has valid latitude and longitude
Altitude-Based Sorting
Helicopters are sorted by altitude (ascending) to prioritize low-flying aircraft:src/helicopters.ts
Lower altitude helicopters are more visually interesting on the isometric map — they appear closer to buildings and are likely doing scenic tours, news coverage, or police operations.
Response Mapping
The top 10 helicopters are mapped to the simplifiedHelicopterState interface:
src/helicopters.ts
Error Handling
The function returns an empty array on any error:src/helicopters.ts
Example Response
HelicopterState Interface
Simplified helicopter state for map rendering.src/helicopters.ts
Field Descriptions
ICAO 24-bit address in hexadecimal. Globally unique aircraft identifier assigned by country of registration.Example:
"a12b34" for a US-registered aircraft (US addresses start with a)Latitude in decimal degrees. Positive values are north of the equator.Range:
-90 to 90Longitude in decimal degrees. Negative values are west of the prime meridian.Range:
-180 to 180Barometric altitude in feet above mean sea level (MSL).NYC helicopters typically operate between 500-2000 feet.
Track angle (direction of movement) in degrees.
0= North90= East180= South270= West
Ground speed in knots (nautical miles per hour).Typical helicopter cruise speed: 80-120 knots
Polling Strategy
The helicopter data is polled on a 12-second interval in the main application:Example: App polling loop
Why 12 Seconds?
- API freshness: ADS-B data updates every 1-2 seconds, but aircraft positions don’t change dramatically in 10-12 seconds
- Rate limiting: Respectful polling interval that avoids triggering API rate limits
- Performance: Reduces unnecessary re-renders and network traffic
- Visual smoothness: Fast enough for real-time feel, slow enough to avoid jitter
Data Source
ADS-B Exchange (adsb.lol) is a community-driven aggregator of ADS-B (Automatic Dependent Surveillance-Broadcast) data from volunteer ground stations worldwide.How ADS-B Works
- Aircraft continuously broadcast their position, altitude, speed, and heading via 1090 MHz radio
- Ground stations receive these broadcasts and forward them to aggregators
- ADS-B Exchange provides a free API to query aircraft positions by geographic area
Coverage
NYC has excellent ADS-B coverage due to:- Multiple volunteer ground stations in Manhattan, Brooklyn, Queens, NJ
- FAA ground stations at JFK, LaGuardia, Newark
- High population density = more receivers
Coverage is nearly 100% for aircraft above 500 feet in the NYC metro area. Very low-altitude helicopters (below 300 feet) may have intermittent coverage.
Common Helicopter Types Over NYC
| Type Code | Manufacturer | Model | Common Use |
|---|---|---|---|
| R44 | Robinson | R44 | Tours, training, news |
| R66 | Robinson | R66 | Tours, corporate |
| B407 | Bell | 407 | Corporate, EMS |
| B429 | Bell | 429 | Corporate, VIP |
| S76 | Sikorsky | S-76 | Corporate, offshore |
| EC35 | Airbus | H135 | EMS, police (NYPD) |
| EC45 | Airbus | H145 | EMS, corporate |
| AS50 | Airbus | AS350 | Tours, utility |