[postgis-users] distance between two points and elevation

MWilson Matthew MWilson at edrnet.com
Tue Mar 10 15:35:32 PDT 2009

Good evening,

  I'm a total postGIS newbie and I've done some searching but I haven't found an answer yet.


  I've found and tried using the st_distance_spheroid function, and that seems to return a result as I would expect.  However, I have a project where my goal is to determine what points fall within ¼ mile of a point that a user would specify as well as determining the elevation difference to the selected points from the user specified point.


  I've defined my geometry field with the Z value that we've pre-calculated, and that seems to show up properly when looking at the values using the st_AsEWKT function.


  I was initially thinking I would have to generate a line object for the two points in question using ST_Makeline, use that distance with the st_length3d_spheroid function to compare with the 2d distance returned by st_distance_spheroid and calculate for the other side of the triangle to get the elevation difference, but that doesn't seem to match the elevation numbers I have.


  I did have to transform everything into latlong to get the distance functions to work...but I have a feeling that I'm over thinking this.  There should be some kind of function to return the Z value difference between two geometries right?  


  Could someone please point me in that direction?




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090310/b40690df/attachment.html>

More information about the postgis-users mailing list