tags:

views:

995

answers:

7

I'm looking into clustering points on a map (lat/longs). Are there any recommendations as to a suitable algorithm that is fast and scalable?

A: 

Are you clustering based on the physical locations given by the latitude and longitude?

Sam Hoice
A: 

Could you perhaps post some code showing what you want to accomplish? I am confused as to what exactly you mean by "clustering". Are you plotting them on a map of the world?

Gilligan
+2  A: 

Google Maps Hacks has a hack, "Hack 69. Cluster Markers at High Zoom Levels", on that.

Also, see Wikipedia on clustering algorithms.

Paul Reiners
A: 

@Gilligan: Yes - I have a series of lat / lngs, and a map viewport. I'm trying to cluster the points that are close together in order to remove clutter.

I already have a solution to the problem (see here), only I am wondering if there is any formal algorithm that solves the problem efficiently.

Mr. Matt
+3  A: 

For a virtual earth application I've used the clustering described here. It's lightning fast and easily extensible.

Geri Langlois
A: 

there is a webservice called geocubes.com. it makes server side clustering. i think it depends on how many points you have to cluster, if you should use a server side solution

A: 

You could look at indexing all your points using a QuadTile scheme, and then based upon the scale the further down the quad-splits you go. All similarly located points will then be near each other in your index, allowing the clustering to happen efficiently.

QuadTiles are an example of Morton Codes, and there is a python example linked from that wikipedia article that may help.

David Dean