[postgis-users] Nearest Operator

Adrian Custer acuster at nature.berkeley.edu
Sat May 10 13:37:22 PDT 2003


Hey Michael,

Since you have the code, wouldn't it be trivial for you to make an SQL
function named SDO_NN out of it and post it to the list?

cheers,
adrian


On Fri, 2003-05-09 at 20:08, Michael O'Sullivan wrote:
>  > Dear all,
>  > Is PostGIS planned to include nearest operator? Just like SDO_NN
>  > operator in
>  > Oracle Spatial.
> 
> 
> Try looking at the FAQ (http://postgis.refractions.net/docs/c191.html)
> 
> 8. What is the best way to find all objects within a radius of another 
> object?
> 
> 
> I use something like this to find the nearest point in the database to a 
> given point. I do a bounding box query as in the FAQ and then select the 
> minimum distance (calculated using length_spheroid) of the subset of 
> points to get the closest point to a given point. Depending on what your 
> data set is (e.g. a projected coordinate system or lat long) you may 
> want to use the distance function rather than length_spheriod.
> My geometries are all Lat/Long based POINT objects (in this case).
> 
> 
> hope this helps,
> 
> Michael
> 




More information about the postgis-users mailing list