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

Problem rendering with leafmap.Map() + lonboard #699

Closed
ncclementi opened this issue Mar 4, 2024 · 12 comments · Fixed by #700
Closed

Problem rendering with leafmap.Map() + lonboard #699

ncclementi opened this issue Mar 4, 2024 · 12 comments · Fixed by #700
Labels
bug Something isn't working

Comments

@ncclementi
Copy link

In this blog that I wrote https://ibis-project.org/posts/ibis-duckdb-geospatial/

I'm doing

import leafmap.deckgl as leafmap

m = leafmap.Map()

m.add_vector(broad_station_gdf, get_fill_color="blue")
m.add_vector(sts_near_broad_gdf, get_color="red", opacity=0.5)
m.add_vector(streets_gdf, get_color="grey", zoom_to_layer=False, opacity=0.3)
m

and I the plot doesn't render correctly, and I get this error

'pyarrow.lib.Table' object has no attribute '_bbox'
'pyarrow.lib.Table' object has no attribute '_bbox'

This used to work before, it's not clear what's happening.

Environment Information

  • leafmap version: leafmap 0.31.2 pyhd8ed1ab_0 conda-forge
  • lonboard version: lonboard 0.6.0 pypi_0 pypi
  • Python version: 3.11.8
  • Operating System: MacOS Sonoma 14.3.1
@ncclementi ncclementi added the bug Something isn't working label Mar 4, 2024
@giswqs
Copy link
Member

giswqs commented Mar 4, 2024

I believe the issue has been resolved in #693. Will be releasing a new version shortly.

@giswqs
Copy link
Member

giswqs commented Mar 4, 2024

v0.31.4 has been released. Try pip install -U leafmap. The conda-forge package might be available in a few hours.

@giswqs
Copy link
Member

giswqs commented Mar 4, 2024

It is an upstream issue. See developmentseed/lonboard#365

@ncclementi
Copy link
Author

I don't get the error but it doesn't render anything. I saw the upstream issue, but they are saying it's because it's using a private method and they close it, so not sure what's going on.

I'll do a clean install and check again.

@ncclementi
Copy link
Author

This is what I get when I run the same code now.

Screenshot 2024-03-04 at 10 55 15 AM

@ncclementi
Copy link
Author

For the record

m = leafmap.Map()
m

renders the world map, but as soon as I try to do m.add_vector(...) the rendering turns out empty

@ncclementi
Copy link
Author

In fact, if I try to run the similar examples from your notebooks here https://leafmap.org/notebooks/83_vector_viz/ in colab, after installing lonboard.

If you add the rendering of m in any of the cells that add something like :

streets = gpd.read_file("nyc_streets.shp")
m.add_gdf(streets, zoom_to_layer=True, pickable=True, get_width=5)
m

or

m.add_vector("nyc_subway_stations.shp", get_radius=10, get_fill_color=[255, 0, 0, 180])
m

You will see that it doesn't render.

@giswqs
Copy link
Member

giswqs commented Mar 4, 2024

The recent lonboard updates might caused this. I will look into it.

@ncclementi
Copy link
Author

Just for the record: I tried downgrading to lonboard==0.5.0 but didn't work either :/

@giswqs
Copy link
Member

giswqs commented Mar 4, 2024

I already identified the root cause of the issue. Will be fixing it later today.

@ncclementi
Copy link
Author

Thank you @giswqs 🙌

@giswqs
Copy link
Member

giswqs commented Mar 5, 2024

The bug has been fixed in #700. Please update the package to v0.31.5. Feel free to reopen if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants