Patch Feature Types

async AsyncCogniteClient.geospatial.patch_feature_types(
patch: FeatureTypePatch | Sequence[FeatureTypePatch],
) FeatureTypeList

Patch feature types.

Parameters:

patch (FeatureTypePatch | Sequence[FeatureTypePatch]) – the patch to apply

Returns:

The patched feature types.

Return type:

FeatureTypeList

Examples

Add one property to a feature type and add indexes

>>> from cognite.client.data_classes.geospatial import Patches
>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.geospatial.patch_feature_types(
...     patch=FeatureTypePatch(
...         external_id="wells",
...         property_patches=Patches(add={"altitude": {"type": "DOUBLE"}}),
...         search_spec_patches=Patches(
...             add={
...                 "altitude_idx": {"properties": ["altitude"]},
...                 "composite_idx": {"properties": ["location", "altitude"]},
...             }
...         ),
...     )
... )

Add an additional index to an existing property

>>> from cognite.client.data_classes.geospatial import Patches
>>> res = client.geospatial.patch_feature_types(
...     patch=FeatureTypePatch(
...         external_id="wells",
...         search_spec_patches=Patches(
...             add={"location_idx": {"properties": ["location"]}}
...         ),
...     )
... )