[postgis-users] drawing a line tangent to earth ?

Stephen Woodbridge woodbri at swoodbridge.com
Mon Feb 5 07:42:23 PST 2018


On 2/5/2018 10:08 AM, didier peeters wrote:
> Hi,
> 
> Here’s the problem that puzzles me:
> I would like to determine if an object (a building,  an antenna, …) can be seen from a specific point ‘somewhere'.  I have to deal with distances ranging from a few meters to about 200 km or so.  I have the coordinates of the viewing point XYZ and the XYZ coordinates of the object to check as well as its height, and I should find what part of the object is viewable above the horizon, i.e. how many meters of it can be seen (considering that the earth is not flat … ) .
> I thought of assimilating the earth to a trigonometric circle but I fear that the precision would not be good enough for evaluating the height of an antenna above the radius of the planet.
> I’m working with Postgresql/postgis and would prefer to remain in this environment but could add some extensions or other languages functions.
> 
> Any suggestion welcome !

Do you have to deal with terrain elevations, like mountains or buildings 
obscuring the line of site view? If so then you probably need to use a 
DEM to construct the surface model and ad buildings to that if needed. 
Typically this kind of application uses ray-tracing. You might be able 
to approximate that by generating vector from points upon the object to 
check to the view point and then intersecting them with you surface 
model and any potential obstructions.

-Steve W

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the postgis-users mailing list