0

I was wondering if there is a plug in for Leaflet which accomplishes clustering features within a grid layer. Similar to marker clusters this allows for rendering an abstraction of all features with a count of the features within that area. In my case I want to do this for centerlines of a city which is too much to render at higher zoom levels.

The overall end effect is similar to what is seen in the LA geohub:

enter image description here

where you need to click the grid till at proper zoom level to render any features.

Stephen Lead
  • 21,119
  • 17
  • 113
  • 240
Diffusion_net
  • 470
  • 4
  • 10

1 Answers1

1

I'm not sure of any existing plugins to accomplish this, so you may need to pre-process your data (for example, using the free desktop program QGIS) to calculate the number of features within each grid cell.

  1. Create a polygon grid/fishnet
  2. Intersect the road centrelines with the polygon grid
  3. Count the number of lines within each polygon

Use the count to symbolise the polygons, as in your example screenshot

Stephen Lead
  • 21,119
  • 17
  • 113
  • 240