[postgis-users] Distance query

Pedro Doria Meunier pdoria at netmadeira.com
Mon Feb 5 11:45:17 PST 2007


Hi All,

 

In the sequence of my last email with the same subject this is the query I
tried (only for the localities layer)

 

select min(distance(u.curr_location, (select geometry from toponimia where
name='Se' limit 1))) as dist 

from units as u 

where u.id=XXXXXXXX;

 

the results aren't quite the expected as:

unit 11111111 is almost over the point with the name 'Se'

unit 80000135 is the second on the list

unit 99999999 is the farthest..

 

These are the result that I got:

80000135 = 3665.52978684708

11111111 = 3666.92134092059

99999999 = 3665.79245878804

 

To my surprise unit 11111111's distance is the greatest..

What is distance() returning anyway?

Btw: both tables have srid=4326

 

Any help would be greatly appreciated since I really have to finish this
task (please see last email with the same subject)

 

Thank you.

Pedro Doria Meunier

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


More information about the postgis-users mailing list