-
Notifications
You must be signed in to change notification settings - Fork 6
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
Does the deck.gl integration support type H3HexagonLayer? #99
Comments
This is an example for using H3HexagonLayer. The developer console says the from maplibre import MapOptions
from maplibre.basemaps import Carto
from maplibre.controls import NavigationControl
from maplibre.ipywidget import MapWidget as Map
m = Map(
MapOptions(
style=Carto.POSITRON,
center=(-122.4, 37.74),
zoom=12,
hash=True,
pitch=40,
)
)
m.add_control(NavigationControl())
deck_grid_layer = {
"@@type": "H3HexagonLayer",
"id": "my-layer",
"data": 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf.h3cells.json',
"getHexagon": "@@=hex",
}
m.add_deck_layers([deck_grid_layer], tooltip="Number of points: {{ count }}")
m |
Yes, you are right. At the moment in ipywidget only the |
@cboettig If you install the latest feature branch with pip install git+https://github.com/eodaGmbH/py-maplibregl@feature/color-utils you can already test the standalone example rendering to html |
pip install git+https://github.com/eodaGmbH/[email protected] makes the H3HexagonLayer also available for Ipywidget |
Thanks, this is working great now! |
In the upcoming release it will now also be possibile to add See this exmaple |
@crazycapivara this would be perfect, thanks. for some reason the example doesn't render correctly for me. I install from this branch, git+https://github.com/eodaGmbH/py-maplibregl@feature/color-utils but just get a blank map, but no error. |
@cboettig Just tested with serveral Python versions (3.9, 3.11, 3.12) on Mac and Linux and it always works for me. |
@crazycapivara Thanks for the reply. I've revisited this and it seems to be working correctly now. I see that in your example you pass a standard pydeck layer directly, instead of the dict syntax
Using a pydeck layer instead of that kind of notation, everything works well for me now:
|
@crazycapivara Hi Stefan, sorry to re-open this, but for some reason it seems to be able to work ok with JSON data but not CSV data. The pure pydeck code works just fine with either source. Here's an example (same as above just converting the sample data to csv). Works fine in pure pydeck:
But the maplibre code fails to render the hexagons for this very same layer:
If I keep everything the same but switch |
@crazycapivara ah, thanks for the explanation, apologies I overlooked that. The feature is very helpful to me because duckdb can stream direct to S3 as csv, whereas to write out to correctly-formatted JSON I've had to materialize into RAM using geopandas first. I see loaders.gl page you link supports geoparquet, that would be even better than csv support. Thanks again for all the help, this module is really fantastic for us. |
Thanks for an amazing package, this has been incredibly useful to me.
I've been enjoying the deck.gl integration you have as well, and the examples in the docs work perfectly for me. However, I cannot get
H3HexagonLayer
to work. is it possible that only some of the deck.gl types are implemented here? Would it be possible to support H3?I noticed that you have an example for H3 cells that uses the native maplibre fill-extrusion, but this approach relies on turning the hex ids to boundaries in geojson, which I am worried will not scale as well since I have a lot of small hexes. I've been able to render this layer with pydeck, but would love to be able to combine that with other maplibre layers using your package.
The text was updated successfully, but these errors were encountered: