-
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 full support for xarray decode_coords
#282
Comments
The first line of pydata/xarray#2844 gives the motivation for the change: "I prefer having these as coordinates rather than data variables." The current behavior of The way I interpret the reason for the PR is that historically, the Side note: I am noticing changes that
|
Another element to this is that when reading in geotiff/png/jpeg files, it does not store the |
@snowman2 coming form the netCDF / CF world (nowadays, I'm a long time GeoTIFF user) I don't see it that way.
|
The main change you want is to make sure the on-disk representation is CF-compliant, correct? If so, then if
Though |
yes
yes (OK, I also would love to optionally have bands as variables, but I will survive doing the |
BTW, the |
Please open a new issue to discuss. Probably a new argument |
Yep. Sounds like a good issue to raise at |
@snowman2 as a final bit.
https://github.com/bopen/xarray-gdal/blob/main/xarray_gdal/xarray_plugin.py#L52 The only serious feature missing is lazy loading of chunked data. It is not intended for release, I wanted just to explore what can be delegated to |
Nice. I like |
xarray 0.17.0 has introduced a way to optionally keep most auxiliary variables associated with a main variable, including
grid_mapping
, inside the correspondingDataArray
: pydata/xarray#2844See: http://xarray.pydata.org/en/stable/weather-climate.html?highlight=decode_coords#related-variables
Current behaviour of
open_rasterio
is to always add thespacial_ref
coordinate with CF attributes, so it is similar to always assumingdecode_coords="all"
(similar but not identical as thegrid_mapping
key / value pair is inDataArray.attrs
instead ofDataArray.encoding
).Fully supporting
decode_coords
while attempting to minimise change means thatopen_rasterio
would return aDataset
fordecode_coords="coordinates"
and continue returning aDataArray
fordecode_coords="all"
that would be the default.I would find such an interface very confusing, but
open_rasterio
already returns different types for different arguments so I'm not sure.Alternatively we could add a new interface that always return a
Dataset
. That would also make adding a plugin for the new backend API or xarray very easy (see #281).The text was updated successfully, but these errors were encountered: