Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map marker clusters at scale #662

Open
tomquas opened this issue Nov 3, 2022 · 3 comments
Open

map marker clusters at scale #662

tomquas opened this issue Nov 3, 2022 · 3 comments

Comments

@tomquas
Copy link

tomquas commented Nov 3, 2022

Is your feature request related to a problem? Please describe.
Typical maps on mobile apps require clustering of markers due to the amount of points being displayed. A bunch of client-side libraries exist but scaling beyond ~50.000 points becomes a bottleneck when frequently loading, parsing, drawing markers updates from a single geojson source.

Describe the solution you'd like
While investigating, i came across this article: Serve Map Clusters 50x Faster Using Smarter Caching by @FlorianPfisterer. Caching for each zoom level seems to make sense...

I also looked into mapbox/supercluster and its go-counterpart MadAppGang/gocluster which calculate cluster nodes efficiently. To say it with MadAppGang's words: 'The cluster use hierarchical greedy clustering approach. The same approach used by Dave Leaver with his fantastic Leaflet.markercluster plugin.'

The benefit of integrating such functionality right into tile38 would be

  1. no more external servers, for example one running mapbox/supercluster
  2. performance! data is being processed right where it sits

One solution that would work perfectly for my project could look like this...

  • a tile38 command to generate a point cluster for a given key; example:
  INTERSECTS key CLUSTER dest_key  ZOOMLEVEL 1 18 BOUNDS ... 

with <dest_key> being generated by tile38 using some scheme, e.g. <dest_key>_{zoomlevel} => dest_key_1, dest_key_2, ... dest_key_18

  • my app adjusting marker layers to a specific dest_key depending on the zoom level of the map

@tidwall is this a feature you would consider integrating into tile38?

@tidwall
Copy link
Owner

tidwall commented Nov 11, 2022

I would consider this, yes.

@bt-maps
Copy link

bt-maps commented Jan 29, 2023

Cluster functionality would be very useful. Also, for feature counts too large for client-side viz, built-in density/heatmapping for point collections would be a distinguishing feature that aligns nicely with the real-time aspect of Tile38.

It's probably better (smarter?) to do it in an app server/middleware, but there is something about the ability to see aggregated activities on a map. In the past, I have found using indexed and clustered point systems like this work well enough for on-demand heat maps. Most modern web mapping libraries now work well with raw pixel data now, so Tile38 wouldn't need image file creation, just blast out the raw pixel data in the response.

INTERSECTS myXYZptcluster TILE X Y Z RAWDENSITYPIXELDATA
Start your Tile38 instance up in "heatmap mode", and everyone gets a strava-style, tiled heatmap.😉

@voslucas
Copy link

I would love this! Any news on the topic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants