[postgis-users] How to Lookup Nearest Locations from a Table

Shlomi Fish shlomif at iglu.org.il
Thu Dec 16 08:05:38 PST 2010


Hi all.

We have a table with a geography column. We'd like, for any given row, to 
return the N nearest *other* rows.  We saw ST_Distance, but is that the only
approach? It feels like it will be slow and will not scale well.  

Is there anything more magical to use? We're pretty new to PostGIS.

While brainstorming we've considered filtering according to nearby latitudes
and/or longtitudes, because if they are too far, then, by necessity, the 
distance will also be too far, but we are not sure if this is the right
approach.

We'd be grateful for any suggestions on how to move forward.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

Chuck Norris can make the statement "This statement is false" a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .



More information about the postgis-users mailing list