x72y5e / radar

Display flight data on the UnicornHatHD module for Raspberry Pi
MIT License
24 stars 4 forks source link

Is there a way to enter only a fixed point and range? #9

Closed DomRRuggeri closed 5 years ago

DomRRuggeri commented 5 years ago

I'm using the latest version with the config.json file, and it works with the default values. For simplicity's sake, I'd like to enter one, fixed, middle coordinate, and a range around it. It seems I need the info for the top and bottom corners to draw the grid. If that's the case, whats the point of the range? Or am I missing something?

Thanks!

x72y5e commented 5 years ago

Hi Yes the feature you describe would be good but I haven't had time to put it in yet. The problem is that there are two distances / ranges in issue: firstly, the range for displaying the grid. This uses lat/lon and is then scaled for the 16x16 matrix of the screen; secondly, the range for getting the aircraft data from the api, which is in km. So we need to ensure that the range from the central point of tracking (which is calculated as the mid-point in the lat/lon map data supplied) is more or less the same as the distance from the middle of the map to its furthest point (corner). The problem is that translating from lat/lon to km is not straightforward, as it depends on where you are. I'm sure there is a library but so far I have found it easier just to add the coordinates from the map. Feel free to attempt this as a patch though.

DomRRuggeri commented 5 years ago

Thanks for the response. So, if I were to place a point at Chicago O'Hare Airport, and wanted a 20km radius, do I need to find the center point Lat/long, then find the Lat/long 10km NW, and the lat/long 10km SE of that initial point?

x72y5e commented 5 years ago

Yes, more or less, but I think it would be 10km SW and 10km NE?