I have a list of geo coordinates. What I want is a list of grid areas and a number of geographic points in that area. By doing this I can get the information in which areas in the world the most points are set.


[lat, lng], ... [lat, lng] -> [gridId, total number of geo coords in that grid]

I want the size of the grid to be configurable, e. g. Zoom Level 8, or by saying Grid with/height should be e.g. 10km. Since I can have a huge amount of positions (possibly hundredthousands of points) the calculation should be efficient. Ideally the list of [gridId, totalNr] should be sorted by totalNr.

What I am currently doing is to use DBSCAN clustering to cluster geo points into groups and calculate the centroid of that group. I think that the grid algorithm could be faster, if the calculation of grids is fast enough.

Im doing it in Javascript. I wanted to use elastic search, but could not find appropriate functions. I also could not find other projects for such an use case.

  • 1
    Could Turf.js be an option. – BritishSteel Feb 25 '16 at 13:02
  • This is a nice coincidence. I already had this on my watchlist. Turf seems to have useful methods, but I cant see how I could use them to fulfill above use case. – user2500558 Feb 25 '16 at 13:27

Your Answer

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

Browse other questions tagged or ask your own question.