corteva / rioxarray

geospatial xarray extension powered by rasterio
https://corteva.github.io/rioxarray
Other
526 stars 83 forks source link

add explore function like in geopandas #794

Closed mhungen closed 3 months ago

mhungen commented 4 months ago

Geopandas provides a handy explore function that creates an interactive folium-map and displays the GeoDataFrame on it. This function is particularly useful when working with Jupyter notebooks.

Since I frequently work with rioxarray and geopandas, I developed a custom xarray accessor to add this functionality to xarray DataArrays as well. Given that rioxarray is the powerhouse handling the heavy lifting, this seems like a good fit for a new feature.

While my implementation is somewhat basic (DataArrays only), it is works and can be combined with the GeoDataFrame. If you're interested, I can create a PR for this feature.

Screenshot from 2024-07-03 17-52-06

snowman2 commented 4 months ago

Thank you for your proposal. I think that would be a very useful feature. Plotting for rioxarray has been a topic of interest (see #208). My suggestion would be to create a separate library for plotting (e.g. rioxarray-plot). This will enable you to have the ability to quickly iterate on features, build a community around plotting with rioxarray, and choose whatever license you would like for your project.

jessjaco commented 3 months ago

FYI this functionality has been added to odc-geo: https://odc-geo.readthedocs.io/en/latest/_api/odc.geo.xr.ODCExtension.explore.html#odc.geo.xr.ODCExtension.explore

mhungen commented 3 months ago

FYI this functionality has been added to odc-geo: https://odc-geo.readthedocs.io/en/latest/_api/odc.geo.xr.ODCExtension.explore.html#odc.geo.xr.ODCExtension.explore

looks good, I'll give it a try