-
Notifications
You must be signed in to change notification settings - Fork 85
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
ds.rio.to_raster() not preserving band level attributes #615
Comments
If you specify it like so, it works: ds[1].gh.rio.to_raster('converted_tiff.tiff')
rds = rioxarray.open_rasterio("converted_tiff.tiff")
rds.attrs
|
Thanks for the report. Fix in #616 |
@snowman2 Eg: each of these data variables pwat, tcc have different attributes + ds level attributes are also different.
I'm assuming that #616 will also be handling multiple bands case as well i.e. attributes will be preserved of each bands + ds level. Any timeline for merging & releasing #616 ? |
I have a xr.Dataset that contains around 43 bands/data variables. Each of those bands/data variables have 34 attributes [assume keys are same but values are different] + it have dataset level attributes as well.
Now I'm creating a tiff out of it using --
ds.rio.ro_raster('filename.tiff')
. Then I opened the created tiff file using --rioxarray.open_rasterio('filename.tiff', band_as_variable=True)
I observed that all of the dataset level attributes are present but all of the band_level attributes are not preserved.Lets us take this file. Note that
gh
variable had 29 attributes in dataset vs 3 attributes when converted into tiff.Code:
Console logs:
Lib versions:
rasterio -- 1.3.2
rioxarray -- 0.13.1
xarray -- 2022.11.0
gdal -- 3.5.1
The text was updated successfully, but these errors were encountered: