[postgis-users] Distance query

Pedro Doria Meunier pdoria at netmadeira.com
Wed Feb 7 07:46:13 PST 2007


Hi Michael,

Txs for replying.

In the table definition for units:
CONSTRAINT enforce_srid CHECK (srid(curr_location) = 4326)
In the table definition for toponimia:
CONSTRAINT enforce_srid_geometry CHECK (srid(geometry) = 4326)

As you can see their srid=4326

The getsrid() also returns 4326...
So.. I'm a bit lost here... :O

Best regards,
Pedro Doria Meunier

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Michael
Fuhr
Sent: quarta-feira, 7 de Fevereiro de 2007 15:11
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Distance query

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
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list