- datacube.utils.geometry.assign_crs(xx, crs=None, crs_coord_name='spatial_ref')¶
Assign CRS for a non-georegistered array or dataset.
Returns a new object with CRS information populated.
Can also be called without
crsargument on data that already has CRS information but not in the format used by datacube, in this case CRS metadata will be restructured into a shape used by datacube. This format allows for better propagation of CRS information through various computations.
xx = datacube.utils.geometry.assign_crs(xr.open_rasterio("some-file.tif")) print(xx.geobox) print(xx.astype('float32').geobox)