natcap / global-web-viewer

A web viewer prototype for visualizing and analyzing global data.
GNU General Public License v3.0
3 stars 1 forks source link

Display CV layer as clusters? #55

Open dcdenu4 opened 3 years ago

dcdenu4 commented 3 years ago

The CV layers have been uploaded and aggregated. The visible layer is a point shapefile, however, it would be nice if it could be a cluster. This way, as you zoom in, more and more points are revealed.

I tried doing this through mapbox gl js, but it looks like they only support geojson data and not vector tiles.

I also used tippecanoe to produce clusters upfront before uploading to mapbox:

docker run -it --rm -v %CD%:/data tippecanoe:latest tippecanoe -zg -o /data/realized_coastal_protection_points_clusters.mbtiles -r1 --cluster-distance=3 --accumulate-attribute=grid_code:mean /data/realized_coastal_protection_points.geojson

This approach could seemingly work, but I was having trouble spacing out the clusters and having ALL the points be visible when fully zoomed in.

Oh, and I was uploading using a python utility I didn't know about: mapbox upload ddenu.rcp-clusters realized_coastal_protection_points_clusters.mbtiles

T.E. : 1 - 3 days.