Continuation of the discussion from #2722 to move onto implementation details.
Tag: @fmaussion @djhoese
Sorry for being late on this one. Yes, I agree that the "coordinate attribute" is worth a try.
To avoid redundancy in the name one could name the coord variable attributes simply wkt and proj4, like:
<xarray.DataArray 'crs' ()>
array(0)
Coordinates:
crs int64 0
Attributes:
wkt: PROJCS["UTM Zone 15, Northern Hemisphere",GEOGCS["WGS 84",D...
proj4: +proj=...
I definitely agree 馃挴 with you on avoiding redundancy. I actually had the same thought. However, part of the reason for using crs_wkt is motivated by CF 1.7 convention. I figured it was a small change that sacrifices redundancy for consistency across the community. The crs_proj4 name was just an attempt to be consistent with your original comment and the crs_wkt. But, I think renaming it to proj4 to remove redundancy is a good choice as well.
@fmaussion just a ping for what are your thoughts are for next steps on this?
Going to close this as it is over a year old.
For reference, WKT support is in rioxarray.
https://corteva.github.io/rioxarray/stable/examples/crs_management.html
@snowman2 @djhoese It'd be nice to update our docs to link to rioxarray and other relevant packages. (e.g. here https://xarray.pydata.org/en/stable/io.html#rasterio).
Adding an example on doing these manipulations would also be very welcome.
Adding an example on doing these manipulations would also be very welcome.
What types of manipulations are you thinking about? Reprojection? Export to geotiff? Clip? Reading in files?
I think we should seriously consider removing all rasterio logic in xarray and make rioxarray an optional dependency to read geotiff files with xarray.
@snowman2 Any/all of those "common operations" sounds good. We don't have a single geoTIFF example: https://xarray.pydata.org/en/stable/examples.html so at this point anything would be a big improvement
I think we should seriously consider removing all rasterio logic in xarray and make rioxarray an optional dependency to read geotiff files with xarray.
:+1: Though maybe we should wait till the backends refactor is done so that things are a little more easy.
@dcherian Maybe a link to these examples in that section then?
https://corteva.github.io/rioxarray/stable/examples/examples.html
Most helpful comment
I think we should seriously consider removing all rasterio logic in xarray and make rioxarray an optional dependency to read geotiff files with xarray.