[postgis] Nearest To Searching

Erik Brenn erb at blom.co.id
Mon Oct 8 04:30:56 PDT 2001


Hi John,

I might be too daring to answer this one, but I'll try anyway.
I don't think your problem of proximity between points can be solved
efficiently with a spatial index like in PostGIS. I'm not sure about Gist
but a spatial index normally work with the bounding rectangles of objects,
and not on the topological interconnections(e.g. distance) between them. I
believe your problem could be described as a bi-directional graph with
distance between points as the edge-costs.  Graph algorithms are expensive
and perhaps better left to be handled by specialised client GIS software
etc.

Anyway, assuming that you can iterate a circle query in PostGIS, you could
increase the radius until you have a count of N points from your query. The
number of required iterations would depend on your data heuristics to set
initial circle size and the radius-increase for each iteration.

regards,
  erik brenn





----- Original Message -----
From: "John Grange" <john.grange at locavista.com>
To: <postgis at yahoogroups.com>
Sent: Monday, October 08, 2001 15:21
Subject: [postgis] Nearest To Searching


> Hi,
>
> Is there any way to easily find the nearest n points to another point.  I
> have tables with many many (millions) of records and I need to locate
> nearest neighbours.
>
> Any ideas?
>
>
> John Grange
> BSc. (Hons) Dunelm
> LocaVista Ltd.
> Orchard House
> Castle Garth
> Kendal, Cumbria
> LA9 7ATTel +441539 739554
> Fax +44 1539 729995
> Mobile +44 7876 038 058
>
>
>
>
> To unsubscribe from this group, send an email to:
> postgis-unsubscribe at yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE VeriSign guide to security solutions for your web site: encrypting transactions, securing intranets, and more!
http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list