mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Does cluster support vector tiles?

Open Roxyi opened this issue 8 years ago • 11 comments

Hi,

I found this example about cluster: Create and style clusters

I tried to add vector tiles source but it did not work. I wonder if the cluster supports vector tiles or if I wanna cluster points data from vector tiles, is there a way to do so?

Thanks

Roxyi avatar Dec 13 '17 19:12 Roxyi

No, clustering requires special processing that is only possibly with GeoJSON sources at this time.

jfirebaugh avatar Dec 13 '17 20:12 jfirebaugh

Any plan to push this special processing at work ? Thanks

Captain-Oski avatar Mar 01 '18 17:03 Captain-Oski

what about that ? https://github.com/mapbox/vt2geojson

matthieugayon avatar Apr 12 '18 21:04 matthieugayon

Are there any plans to implement this? Even if the clustering math is limited on a per-tile basis

cc @mourner

waissbluth avatar Feb 21 '19 19:02 waissbluth

Two years, any updates on this feature or are we still limited to used geoJson sources at this time

asmith13194 avatar Sep 19 '19 20:09 asmith13194

nooo I'm bummed, just refactored the whole site using mapbox tiles instead of loading our big GeoJSON on client level all the time.... clustering should work with vector-tiles too

csimpi avatar Jan 14 '20 15:01 csimpi

"You can cluster data to put into a vector tile source using Tippecanoe, but can not create a cluster from a vector tile source on the fly without some custom code." We ended up using Tippecanoe to add clusters to vector tiles.

Great thanks to @ ryanbaumann

Link: https://github.com/mapbox/mapboxgl-jupyter/issues/71#issuecomment-411771580

rayer10 avatar Oct 31 '20 12:10 rayer10

Any updates on this feature or are we still limited to using geoJson sources?

chinthakaherath avatar Sep 19 '23 11:09 chinthakaherath

Hello, have been any update on this feature? Thanks

gcontrerasj avatar Jan 03 '24 13:01 gcontrerasj

Hello! Any updates?

AndreyPhilippov avatar Jun 06 '24 12:06 AndreyPhilippov

If you have the raw data in your postgis database, you can cluster it in real time.

Refer to this clustering method in postgis with the following the distances in meters per zoom for the cluster radius. Then just return that data in tiles.

Because clustering can be very expensive at lower zoom levels, you can just return pre-compute at lower zoom level and return real time at higher zoom level.

By using this method, you can also bypass the "clustering math is limited on a per-tile basis" waissbluth mentioned above

The "special processing that is only possibly with GeoJSON sources" is probably the greedy clustering algo implemented on mapbox clusters. You can just precompute by creating a matview around your clustered data and then return that as tiles

thejasonxie avatar Jun 07 '24 17:06 thejasonxie