[postgis-users] Distance query

Michael Fuhr mike at fuhr.org
Wed Feb 7 07:10:31 PST 2007


On Wed, Feb 07, 2007 at 09:57:35AM -0000, Pedro Doria Meunier wrote:
> Distance() is still not returning the expected values. Please see the
> results below.
> 
> All geometries SRID=4326
[...]
> 'units' Layer:
> 
> Unit 80000135 curr_location = "POINT(3239.3462 -1650.4789)"
> Unit 11111111 curr_location = "POINT(3238.82678 -1654.51)"
> Unit 99999999 curr_location = "POINT(3241.00088 -1647.84688)"

SRID 4326 coordinates should be longlat, which these coordinates
apparently aren't.  What SRID are they?  You could transform them
to 4326 and use distance_sphere() to get distance in meters, or if
these coordinates are already in meters then you could transform
the 4326 coordinates to this SRID and use distance().

-- 
Michael Fuhr



More information about the postgis-users mailing list