-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add very minimal xarray plugin for engine="rasterio"
#281
Conversation
Codecov Report
@@ Coverage Diff @@
## master #281 +/- ##
==========================================
- Coverage 93.68% 92.59% -1.09%
==========================================
Files 12 13 +1
Lines 1362 1378 +16
==========================================
Hits 1276 1276
- Misses 86 102 +16
Continue to review full report at Codecov.
|
One thing I am noticing in these examples is that the attributes for the |
You are right, I used Anyway the whole PR is work in progress. If you like the idea we can discuss the direction to go here, or in the main issue. |
@snowman2 The current implementation is just to see where I'd be aiming following pydata/xarray#2844 >>> import xarray as xr
>>> xr.open_dataset("test/test_data/input/cog.tif", decode_coords="coordinates") # or decode_coords=True
<xarray.Dataset>
Dimensions: (band: 1, x: 500, y: 500)
Coordinates:
* band (band) int64 1
* y (y) float64 2.715e+06 2.714e+06 ... 2.565e+06 2.565e+06
* x (x) float64 1.635e+06 1.635e+06 ... 1.784e+06 1.784e+06
Data variables:
spatial_ref int64 ...
band_data (band, y, x) int16 ...
>>> xr.open_dataset("test/test_data/input/cog.tif", decode_coords="all")
<xarray.Dataset>
Dimensions: (band: 1, x: 500, y: 500)
Coordinates:
* band (band) int64 1
* y (y) float64 2.715e+06 2.714e+06 ... 2.565e+06 2.565e+06
* x (x) float64 1.635e+06 1.635e+06 ... 1.784e+06 1.784e+06
spatial_ref int64 ...
Data variables:
band_data (band, y, x) int16 ... I didn't manage to add the The best course of action would be to implement |
engine="gdal"
engine="rasterio"
Co-authored-by: Alan D. Snow <alansnow21@gmail.com>
@alexamici are you aware of the target release date for xarray 0.18? |
@alexamici am I good to squash and merge? (rasterio 1.2.2 was just released and looks like it is breaking things, so I am not worried about test failures related to this PR). |
Release should be "soonish", but we have no target date to my knowledge. Anyway the changes are totally backward compatible, since che |
You can merge now for me. |
Thanks @alexamici 👍 |
Use xarray plugin infrastructure to add support for:
also add automatic engine selection for files with
.tif
and.geotif
extensions.docs/history.rst
for all changes anddocs/rioxarray.rst
for new API