Create feature types

async AsyncCogniteClient.geospatial.create_feature_types(
feature_type: FeatureType | FeatureTypeWrite | Sequence[FeatureType] | Sequence[FeatureTypeWrite],
) FeatureType | FeatureTypeList

Creates feature types.

Parameters:

feature_type (FeatureType | FeatureTypeWrite | Sequence[FeatureType] | Sequence[FeatureTypeWrite]) – feature type definition or list of feature type definitions to create.

Returns:

Created feature type definition(s)

Return type:

FeatureType | FeatureTypeList

Examples

Create new type definitions:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.geospatial import FeatureTypeWrite
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> feature_types = [
...     FeatureTypeWrite(external_id="wells", properties={"location": {"type": "POINT", "srid": 4326}})
...     FeatureTypeWrite(
...       external_id="cities",
...       properties={"name": {"type": "STRING", "size": 10}},
...       search_spec={"name_index": {"properties": ["name"]}}
...     )
... ]
>>> res = client.geospatial.create_feature_types(feature_types)