block by emeeks 1a75ec54489368b514f8

Feature Clustering - d3.carto

Full Screen

Quadtree-based feature clustering in d3.carto.map.

This is an early example of how using the quadtrees generated with each layer could also be used with feature layers. This allows you to dynamically aggregate features based on zoom. Polygons are colored by their shared grouping at different zoom levels. This version uses centroids–the final version will likely either use bounding box solely or give the option for both.

See also simple point clustering and more advanced point clustering that leverages circle-packing.

This also uses a custom formatter for the infoboxes to give you the name of an unclustered feature and the number of features in a clustered region.

index.html

d3map.css