From fa4a9358bd24493c08b54ee55ab0e64f9ab2f360 Mon Sep 17 00:00:00 2001 From: "Alan D. Snow" Date: Wed, 10 Mar 2021 15:02:51 -0600 Subject: [PATCH] DOC: Fix 2D coordinate example (pydata/xarray/issues/5005) --- rioxarray/_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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