Get raster data
- async AsyncCogniteClient.geospatial.get_raster(
- feature_type_external_id: str,
- feature_external_id: str,
- raster_property_name: str,
- raster_format: str,
- raster_options: dict[str, Any] | None = None,
- raster_srid: int | None = None,
- raster_scale_x: float | None = None,
- raster_scale_y: float | None = None,
- allow_crs_transformation: bool = False,
-
- Parameters:
feature_type_external_id (str) – Feature type definition for the features to create.
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 output format
raster_options (dict[str, Any] | None) – GDAL raster creation key-value options
raster_srid (int | None) – the SRID for the output raster
raster_scale_x (float | None) – the X component of the output pixel width in units of coordinate reference system
raster_scale_y (float | None) – the Y component of the output pixel height in units of coordinate reference system
allow_crs_transformation (bool) – When the parameter is false, requests with output rasters in Coordinate Reference System different from the one defined in the feature type will result in bad request response code.
- Returns:
the raster data
- Return type:
bytes
Examples
Get a raster from a feature raster property:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> feature_type = ... >>> feature = ... >>> raster_property_name = ... >>> raster_data = client.geospatial.get_raster( ... feature_type.external_id, ... feature.external_id, ... raster_property_name, ... "XYZ", ... {"SIGNIFICANT_DIGITS": "4"}, ... )