mutability / dump1090

Dump1090 is a simple Mode S decoder for RTLSDR devices
528 stars 137 forks source link

Display of Air Distance and Elevation added. #158

Closed OrbitTheSun closed 5 years ago

OrbitTheSun commented 8 years ago

I added output for air distance and elevation of a selected plane. The table has a new column "Elev." which can be sorted as well. Maximum elevation and minimum air distance are displayed when seen.

dragonyzl commented 8 years ago

Hi, I did something like you, calculate the Range, Azimuth and Elevation! https://github.com/dragonyzl/dump1090/tree/RAE_UDP

mutability commented 8 years ago

I don't think your maths is right here. You can't assume a flat earth for anything other than short ranges.

@dragonyzl 's conversion looks more correct, transforming to ENU is the way to do it (but the implementation is massive overkill)

OrbitTheSun commented 8 years ago

Hi all, you're right, assuming a flat earth for computing the elevation is a simplification. But the error is small and the calculation of distance and elevation is a two-liner. I checked the error for a plane with 100 km ground distance and 10 km altitude. Its below one degree. The values are:

Correct elevation: 5.256 degrees Flat earth calculation: 5.71 degrees

Correct distance: 100.5758 km Flat earth calculation: 100.499 km

The elevation and air distance values should only be considered as a hint where to look and how far the plane actually is in the sky. Thus the plane is moving, no arc minute accuracy is needed.

But there is a bigger error source and this is because the observers altitude is not considered. So sea level is assumed. Perhaps one could add a command line parameter to enter site altitude into the equation.

Greetings Andreas

OrbitTheSun commented 8 years ago

I added URL parameters lat, lon and height to set the site position individually for each client. Observer height can also be set alone / additionally.

Air distance and elevation are now calculated exactly. The height of the observer and the shape of the earth are taken into account.

Romeo-Golf commented 7 years ago

I would find this useful, especially if the numbers are now accurate :)