I'm looking for a GIS/Geometric algorithm:
I have 1000 points randomly distributed in a large area(such as a city), How can I find out all the small ar开发者_C百科eas which have more than 15 points? Like this picture below:
Each point has its own latitude and longitude coordinates. The small area less than 200m x 200m.
You should take a look at RTREE structures. See http://en.wikipedia.org/wiki/R-tree
You've such algorithms implemented e.g. in the SQlite3 engine. See http://www.sqlite.org/rtree.html
Our Open Source version already includes the RTREE extension for Delphi 6 up to XE, compiled by default since rev. 1.8.
Not sure what your performance requirements are. But a naive implementation would be, for each point, to sum up the inverse of the distance to all other points:
for i := 0 to 999 do
for j := 0 to 999 do
if i<>j then
Point[i].Score := Point[i].Score + ( 1 / Distance(Point[i], Point[j]) );
The points near the center of each accumulation area will have the highest score.
精彩评论