vvanouytsel / jetspotter

MIT License
22 stars 2 forks source link

Feature request: Lat/Long Coords #24

Open grigozekios opened 6 months ago

grigozekios commented 6 months ago

If possible it would be nice to have the latitude and longitude coordinates the moment the aircraft are spotted. Keep up the good work!

vvanouytsel commented 6 months ago

I thought it was going to be something very trivial to add, but it seems that the coordinates are available through either lat and long or rr_lat and rr_long. According to the docs the rr_lat and rr_long are populated if the coordinates are not available via the transponder. In that case the approximate position of the receiver is used.

For civilian aircraft:

    {
      "hex": "495298",
      "type": "adsb_icao",
      "flight": "TAP4UL  ",
      "r": "CS-TTX",
      "t": "E195",
      "desc": "EMBRAER ERJ-190-200",
      "ownOp": "Tap Express",
      "alt_baro": 296,
      "alt_geom": 296,
      "gs": 18,
      "track": 142.9,
      "baro_rate": 51,
      "squawk": "1000",
      "category": "A3",
      "lat": 51.284389,
      "lon": 6.75808,
      "nic": 8,
      "rc": 185,
      "seen_pos": 6.971,
      "recentReceiverIds": [],
      "version": 2,
      "nic_baro": 0,
      "mlat": [],
      "tisb": [],
      "messages": 33817,
      "seen": 7,
      "rssi": -49.5,
      "dst": 66.613,
      "dir": 79
    }

For military aircraft:

    {
      "hex": "ae014a",
      "type": "mode_s",
      "r": "59-1466",
      "t": "K35R",
      "dbFlags": 1,
      "desc": "Boeing KC-135R Stratotanker",
      "rr_lat": 40.7,
      "rr_lon": 12.8,
      "alert": 0,
      "spi": 0,
      "mlat": [],
      "tisb": [],
      "messages": 1360,
      "seen": 11,
      "rssi": -26.5
    },

Reference

In other words, it will need some more thought before implementation. What would your use case be for this? I am wondering if I would just display lat and lon if available, otherwise hide it.. Would the rr_lat and rr_lon be useful for your use case, as that is only the approximate location of the receiver that picked up the signal of the aircraft, so it could be far away from the real location of the aircraft.

grigozekios commented 6 months ago

Thank you for your swift response. My area of interest has very spotty coverage, so if the coordinates (lat/lon) or even just the relative coordinates (rr_lat/rr_lon) are shown the moment the aircraft is spotted, I could get a better understanding of where the aircraft potentially took off or where it landed.