The open_geotiff accessor method...
#3213
brendancol
started this conversation in
Show and tell
Replies: 2 comments 8 replies
-
|
To clarify, this means we can read multiple TIFF files at once and stack them together into an xr.Dataset? And also align them so they have the same shape and CRS? |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Can the geotiff loader be accessed through xr.open_[mf]dataset(engine=) instead of importing xrspatial explicitly? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For folks that don't know, xarray-spatial provides a GDAL-free open_geotiff function:
xarray-spatial also provides an xr.DataArray / xr.Dataset accessor method
.xrswhich exposes theopen_geotifffunction ON an xarray.DataArray or xarray.Dataset object that can then serve as a template for loading additional data:Simple example:
A few things to note here:
unpackparameter is analogous tomask_and_scale, and named because it aligns with the inverse operation, which is calledpackwhich is easier to say thanunmask_and_unscale.auto_reproject, which will auto reproject the data into the, to match the caller's CRS.coregisterindicates to return the output with matching shape, bounds, chunks and CRS of the caller object.The vision here is that scaling, masking, reprojecting, and resampling are common enough tasks that it will be valuable to users to focus on making those steps easy from the beginning to speed up time to "analysis ready" arrays.
There are some difficult edge cases:
Would love to hear what people think.
Beta Was this translation helpful? Give feedback.
All reactions