Open
Description
Currently Dataset.proj("coord_name").crs
can be used to access the CRS of either a spatial reference (scalar) coordinate or a CRS-aware indexed coordinate.
This could probably be extended to data variables as well, which may also be CRS-aware if they have spatial dimensions. Dataset.proj("data_var_name").crs
could either return:
- The CRS returned by
Dataset.proj("spatial_ref_name").crs
ifDataset["data_var_name"].attrs["grid_mapping"] == "spatial_ref_name"
(as inspired by CF conventions) - Implicitly fallback to
Dataset.proj.crs
if there is a unique CRS
To set the CRS of a data variable we could reuse Dataset.map_crs(spatial_ref_name=["data_var_name"])
, which will basically (re)set the "grip_mapping" attribute of the given data variable(s).