xarray.Dataset.xvec.decode_cf

xarray.Dataset.xvec.decode_cf#

Dataset.xvec.decode_cf()#

Decode geometries stored as CF-compliant arrays to shapely geometries.

The following invariant is satisfied:

assert ds.xvec.encode_cf().xvec.decode_cf().identical(ds) is True

A GeometryIndex is created automatically and CRS information, if available following CF’s grid_mapping convention, will be associated with the GeometryIndex.

This function uses cf_xarray.geometry.decode_geometries under the hood, and will only work on Datasets.

Returns:
Dataset