Put raster data
- async AsyncCogniteClient.geospatial.put_raster(
- feature_type_external_id: str,
- feature_external_id: str,
- raster_property_name: str,
- raster_format: str,
- raster_srid: int,
- file: str | Path,
- allow_crs_transformation: bool = False,
- raster_scale_x: float | None = None,
- raster_scale_y: float | None = None,
-
- Parameters:
feature_type_external_id (str) – No description.
feature_external_id (str) – one feature or a list of features to create
raster_property_name (str) – the raster property name
raster_format (str) – the raster input format
raster_srid (int) – the associated SRID for the raster
file (str | Path) – the path to the file of the raster
allow_crs_transformation (bool) – When the parameter is false, requests with rasters in Coordinate Reference System different from the one defined in the feature type will result in bad request response code.
raster_scale_x (float | None) – the X component of the pixel width in units of coordinate reference system
raster_scale_y (float | None) – the Y component of the pixel height in units of coordinate reference system
- Returns:
the raster metadata if it was ingested successfully
- Return type:
Examples
Put a raster in a feature raster property:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> feature_type = ... >>> feature = ... >>> raster_property_name = ... >>> metadata = client.geospatial.put_raster( ... feature_type.external_id, ... feature.external_id, ... raster_property_name, ... "XYZ", ... 3857, ... file, ... )