diff --git a/rioxarray/_io.py b/rioxarray/_io.py index 930ab767..3bac1a15 100644 --- a/rioxarray/_io.py +++ b/rioxarray/_io.py @@ -650,7 +650,7 @@ def open_rasterio( from affine import Affine da = xr.open_rasterio('path_to_file.tif') - transform = Affine.from_gdal(*da.attrs['transform']) + transform = da.rio.transform() nx, ny = da.sizes['x'], da.sizes['y'] x, y = np.meshgrid(np.arange(nx)+0.5, np.arange(ny)+0.5) * transform