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

xarray.to_rasterio() #62

Closed
benehiebl opened this issue Apr 21, 2023 · 2 comments
Closed

xarray.to_rasterio() #62

benehiebl opened this issue Apr 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@benehiebl
Copy link

xr.open_rasterio() doesnt work with the latest xarray package (encountered in wx.to_array(..)).
can be solved easily by adding rioxarray to utils.py (or specify xarray version).

aazuspan added a commit that referenced this issue Apr 23, 2023
xarray just dropped the deprecated open_rasterio method, so
this swaps in rioxarray.open_rasterio when calling to_xarray.
This is a potentially breaking change because the two methods
stored slightly different metadata in the resulting dataset
(e.g. ds.crs must now be accessed through ds.rio.crs).

In the process of getting pre-commit checks to pass, we also
had to update all the outdated, broken hooks and make a few
changes to get mypy passing.
@aazuspan
Copy link
Owner

aazuspan commented Apr 23, 2023

Thanks for pointing this out @benehiebl! The next release will replace xarray.open_rasterio with rioxarray.open_rasterio. I'll keep this open until that is released.

In the meantime, anyone encountering this issue can resolve it with either...

pip install git+https://github.com/aazuspan/wxee

to download the pre-release bug fix or...

pip install "xarray<=2023.03.0"

to download the last xarray that supported open_rasterio.

aazuspan added a commit that referenced this issue Apr 23, 2023
Swap xarray.open_rasterio for rioxarray.open_rasterio #62
@aazuspan aazuspan added the bug Something isn't working label Apr 23, 2023
@aazuspan
Copy link
Owner

Fix is released in 0.4.0

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

No branches or pull requests

2 participants