wiedehopf / tar1090

Provides an improved webinterface for use with ADS-B decoders readsb / dump1090-fa
Other
1.22k stars 224 forks source link

Query closest aircraft in json [Feature Request] #218

Closed SingingDwarf closed 1 year ago

SingingDwarf commented 1 year ago

It would be great if tar1090 could show the closest aircraft within a json message, just as Virtual Radar Server does using the closestAircraft.json URL

This would mean that I could query the system and easily find the closest aircraft flying over my house, displaying on an eInk display or other system without pulling and manipulating the entire aircraft.json message.

SingingDwarf commented 1 year ago

Although it is not clear from the reply above(?), it appears that this functionality may already have been implemented - https://github.com/wiedehopf/readsb/blob/dev/README-json.md#--net-api-port-query-formats

wiedehopf commented 1 year ago

Why are you opening a new PR when i closed this one.

wiedehopf commented 1 year ago

just read the readme

wiedehopf commented 1 year ago

You found the relevant thing, the api port ... use it.

SingingDwarf commented 1 year ago

I didn't understand why this one was closed initially with no comment, then figured it out from the JSON document (which wasn't easy to find, as it's not in the root - I stumbled across it via Google).

I then figured you misunderstood the request, as I don't think the API does what I want - show the single most closest aircraft, not all aircraft within a circle around a location.

If I misunderstood and it does do this, apologies, but the documentation is not clear.

wiedehopf commented 1 year ago
/?closest=<lat>,<lon>,<radius in nmi>
SingingDwarf commented 1 year ago

Ah thanks, I was using 'circle' - apologies, I did not see the 'closest' option. Thank you.