Utilizing https://github.com/geoarrow/deck.gl-layers for mapgl #71
Replies: 8 comments 20 replies
-
|
deck.gl support would be cool. A side comment, but PMTiles works rather nicely for plotting millions of polygons, like this building dataset. This should be a reproducible example that runs quickly: should have buildings of the world. |
Beta Was this translation helpful? Give feedback.
-
|
This is the dream! Let me know if anything comes up from the geo/nanoarrow end of things that would be helpful for me to take a look at! |
Beta Was this translation helpful? Give feedback.
-
|
💯 agree with @tim-salabim -- vector tiles are ideal for this very big data we can take the time to pre-render and host, but not a viable option for data assets that might be generated on the fly, e.g. in a shiny app. (aside but I also ❤️ that toggle to globe projection you have there!) I would definitely love to see deck-gl layers! And being able to leverage arrow would be amazing. Meanwhile, there are some decent if largely intuitive suggestions in the maplibre docs, as well as extensions that support other formats than geojson. FWIW, I've been spitballing how to do quick render and aggregates for very large data using @walkerke 's amazing maplibre bindings here and a few extensions. Here's a rough proof-of-concept that aggregates species occurrences to arbitrary zoom levels (h3 hex sizes 0-11) over arbitrary selected spatial areas from a global database of 3 billion rows (347 GB) using duckdb + h3 extension + mapgl https://shiny.carlboettiger.info/ |
Beta Was this translation helpful? Give feedback.
-
|
This is amazing stuff - thanks for the discussion @tim-salabim @cboettig @paleolimbot! Leveraging arrow + deck.gl in mapgl would be fantastic, especially for these big data visualization use-cases. Mapbox / MapLibre tend to choke once you hit a million or so GeoJSON features. With respect to whether this merits a separate package, or should be included in mapgl's codebase: I'll give this some thought, I'm open to either. If it were to be included, we'd probably want some degree of consistency with respect to how people interact with and style regular Mapbox / MapLibre layers vs. deck.gl layers, which would take some work. That said, mapgl has a fairly well-developed Shiny interface that I could see people wanting to use with the deck.gl layers. |
Beta Was this translation helpful? Give feedback.
-
I would suggest to stay as close to
Yeah, shiny is always a layer on top of the original, so there's room for diverting from the original definitions. But for adding a deckgl suite of My suggestion is to start with a package, and we can take it from there. How does that sound? |
Beta Was this translation helpful? Give feedback.
-
|
Love the vision @tim-salabim outlines here! Re:
Just a note on this, some approaches to these heuristics are already outlined in the tippecanoe library (C++), which builds vector tiles like PMTiles. For instance, line-type data can be filtered by weight at different zooms (i.e. low zooms show highways, only high zooms include tiny lanes and streets). With polygons, the strategies involve simplifying polygons at low zooms, and dropping very small polygons. The right choice depends on the data specifics though -- e.g. dropping polygons is good for the building footprint example above but looks weird if the polygons should tessellate the area (like census tracts, say). (total tangent but R bindings to tippecannoe would be awesome). Cool to see geoarrowDeckgl! |
Beta Was this translation helpful? Give feedback.
-
I agree that having R bindings to tippecanoe would be awesome, but just to be clear, I was thinking about doing this on-the-fly in the browser as the user zooms and pans around... |
Beta Was this translation helpful? Give feedback.
-
|
@tim-salabim take a look at https://loaders.gl/examples/tiles/table-tiler I think it does exactly what you are after |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi @walkerke and everyone who may be interested (and tagged :-) ).
As alluded to in #57 (comment) I want to implement something that utilizes the blazing fast data transfer from R to the browser using apache arrow. With the awesome work of @paleolimbot (
nano-/geoarrow) & @kylebarron (geoarrow/deck.gl-layers) we can leverage this nicely now from R.My earlier efforts trying to add this on top of leaflet are not too encouraging, so I have been playing around with the maplibre part of mapgl and things look quite promising. Below is a pseudo-reproducible example (reading the data directly from the github source takes awefully long, hence the GDAL download part to get the data) that should highlight what this is capable of. The roughly 1M building footprints of Idaho, US render nicely and map creation is basically instant!
A few things I noticed:
set_viewbut it seems it only respects the longitude part of the center and lat is always 0There are probably a lot of things left unanswered here, but I wanted to get the ball rolling and start discussion on how to proceed from here. One obvious question is whether this should eventually make its way into mapgl's code base or if its better hosted in a separate package. I clearly prefer the latter!
All in all, I am quite happy with how this is working. Feedback and suggestions more than welcome!
Beta Was this translation helpful? Give feedback.
All reactions