Wednesday, 14 December 2016

postgresql - PostGIS - Dynamic Server-Side Clustering based on Zoom level


I'm working on a Ruby on Rails application that is showing road signs on the map(leaflet). So, user can browse map and road signs, great. But, if there are a lot of signs and user wants to zoom out, there are obvious problems for my app.



  • First problem is to prevent loading a lot of elements (signs) at the same time.

  • And the second problem is to have clear view of elements on the map.


This:


enter image description here



Insted of this:


enter image description here


Solution by my research is to cluster elements by locations as user is zoom-ing in and out. More precisely, using k-means algorithm.


My questions are :



  1. Are there some done solutions for this?

  2. If done solutions not exists, how to use k-means algorithm with zoom level?


I'm using Postgres database with Postgis extension and Ruby on Rails build API.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...