Description
This is my first time submitting an issue, so sorry if doing this wrong.
In the documentation for open_rasterio there's an example on how to generate 2D coordinates from a GeoTiff file using it:
xarray/xarray/backends/rasterio_.py
Lines 177 to 181 in 37522e9
However, this method does not really work because the da.attrs['transform']
attribute is not coded in the GDAL standard, but as affine.Affine
expects directly (maybe it wasn't so in a previous version. So, at least for me (v0.16.2), getting the affine transformation right is done by simply replacing that line with the simpler:
transform = Affine(*da.attrs['transform'])
Again, sorry if this is not how this should be done, I just took a while to figure this out for my application and thought other people might benefit from it. If I can do something to fix it (if it's really broken) please let me know.