odc.geo.xr.assign_crs

odc.geo.xr.assign_crs(xx, crs, crs_coord_name='spatial_ref')[source]

Assign CRS for a non-georegistered array or dataset.

Returns a new object with CRS information populated.

xx = xr.open_rasterio("some-file.tif")
print(xx.odc.crs)
print(xx.astype("float32").crs)
Parameters:
Return type:

TypeVar(XrT, DataArray, Dataset)