After doing a lot of research on different types of clustering coordinates (server side) I am still having problems with choosing the best approach for my project.

My requirements:

  1. Ability to work with more than 1.000,000 coordinates.
  2. Be able to filter coordinates by point of interest.
  3. Support map zooming and dragging.
  4. Fast
  5. I can't use any third party services.

Here is what I found:

  1. Region quadtree seems to the most suitable algorithm.
  2. Geo hashing coordinates + Solr for quick retrieval/filtering of points (might only work with small set of data since the clustering will have to happen on the fly)

I would like to know how to deal with map zooming & dragging while maintaining fast response from the server. How can clusters be cached if the maps is dragged, zoomed? Some clusters can be pre-clustered for large areas (continents) but what if there are 10,000 points within once city?

My software stack is postgresql, python, django.


Source Code for Clustering with Google Maps and Python with Django


you will need to modify for postgres database as this uses MySQL (+spatial extensions)

Working Example: http://www.mapaplace.com/Vancouver/BC/

  • I found this site before. It's much slower than maptimize for example. – Eeyore Mar 10 '11 at 3:13

Maptimize could be useful.

  • I know about their service. However, I can't use any third party services. I will add it to my requirements to make my question more clear. – Eeyore Mar 10 '11 at 3:08
  • This is nonfree, not open source and SUPER EXPENSIVE. – Dirbaio Mar 5 '15 at 23:00
  • ...maybe LESS expensive than some open-source IT consultants ! – julien Mar 6 '15 at 8:03

You could also try this:


it uses kmeans and/or grid clustering, and you can easily adjust/rewrite it to your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.