# Calculating distance from a central point in three dimensions and visualising the result

We will shortly be collecting data from our remote systems that track ADS-B signals from Aircraft. This data will provide the lat/lon in epsg:4326 (wgs84) and a height in meters. The station location is known in EPSG:4326 as a lat/lon.

We want to be able to visualize the effective range of the signals for planning additional stations. The 3D is required to visualize LOS (line of Sight) shadows due to mountains, man made obstacles, etc.

How do we do the following using PostGis:

• Calculate the bearing from True North from the station to the aircraft position
• Calculate the distance over the ground between the two points
• Calculate the distance to the point factoring in the height as well.

Assuming that we then store in a PostGis Database the furthermost distance for each radial, how do we do the following using PostGis:

• Create a cool looking polygon that connects the points with curves in 2D for use in OpenLayers
• Create a cool looking polygon that connects the points with curves taking in the height (z) for output to a kml file for use in Google Earth to visualize the range three dimensionally
• If you want a viewshed analysis you might consider using GRASS. Commented Aug 25, 2013 at 20:35
• Take a look at this Online Google Earth Airspace Awareness Tool kdotapp2.ksdot.org/KDOT_AirSpace/Default.aspx
– Mapperz
Commented Aug 25, 2013 at 21:44
• @Mapperz What a NICE Tool. This is what I had in mind for visualizing our data. The idea is to see where the radio reception is good and poor and understand why. often terrain plays a big part in he LOS reception. Then we can site additional receivers to compensate. Commented Aug 26, 2013 at 1:23