openapi: 3.1.0
info:
title: Cognite 3D Asset Mapping Geospatial API
description: "# Introduction\nThis is the reference documentation for the Cognite API with\nan overview of all the available methods.\n\n# Postman\nSelect the **Download** button to download our OpenAPI specification to get started.\n\nTo import your data into Postman, select **Import**, and the Import modal opens.\nYou can import items by dragging or dropping files or folders. You can choose how to import your API and manage the import settings in **View Import Settings**.\n\nIn the Import Settings, set the **Folder organization** to **Tags**, select\n**Enable optional parameters** to turn off the settings, and select **Always inherit authentication** to turn on the settings. Select **Import**.\n\nSet the Authorization to **Oauth2.0**. By default, the settings are for Open Industrial Data. Navigate to [Cognite Hub](https://hub.cognite.com/open-industrial-data-211) to understand how to get the credentials for use in Postman.\n\nFor more information, see [Getting Started with Postman](https://developer.cognite.com/dev/guides/postman/).\n\n# Pagination\nMost resource types can be paginated, indicated by the field `nextCursor` in the response.\nBy passing the value of `nextCursor` as the cursor you will get the next page of `limit` results.\nNote that all parameters except `cursor` has to stay the same.\n\n# Parallel retrieval\nAs general guidance, Parallel Retrieval is a technique that should be used when due to query complexity, retrieval of data in a single request is significantly slower than it would otherwise be for a simple request. Parallel retrieval does not act as a speed multiplier on optimally running queries. By parallelizing such requests, data retrieval performance can be tuned to meet the client application needs. \n\nCDF supports parallel retrieval through the `partition` parameter, which has the format `m/n` where `n` is the amount of partitions you would like to split the entire data set into.\nIf you want to download the entire data set by splitting it into 10 partitions, do the following in parallel with `m` running from 1 to 10:\n - Make a request to `/events` with `partition=m/10`.\n - Paginate through the response by following the cursor as explained above. Note that the `partition` parameter needs to be passed to all subqueries.\n\nProcessing of parallel retrieval requests is subject to concurrency quota availability. The request returns the `429` response upon exceeding concurrency limits. See the Request throttling chapter below.\n\nTo prevent unexpected problems and to maximize read throughput, you should at most use 10 partitions. \nSome CDF resources will automatically enforce a maximum of 10 partitions.\nFor more specific and detailed information, please read the ```partition``` attribute documentation for the CDF resource you're using. \n\n# Requests throttling\nCognite Data Fusion (CDF) returns the HTTP `429` (too many requests) response status code when project capacity exceeds the limit.\n\nThe throttling can happen:\n - If a user or a project sends too many (more than allocated) concurrent requests.\n - If a user or a project sends a too high (more than allocated) rate of requests in a given amount of time.\n\nCognite recommends using a retry strategy based on truncated exponential backoff to handle sessions with HTTP response codes 429.\n\nCognite recommends using a reasonable number (up to 10) of `Parallel retrieval` partitions.\n\nFollowing these strategies lets you slow down the request frequency to maximize productivity without having to re-submit/retry failing requests.\n\nSee more [here](https://docs.cognite.com/dev/concepts/resource_throttling).\n\n# API versions\n## Version headers\nThis API uses calendar versioning, and version names follow the `YYYYMMDD` format.\nYou can find the versions currently available by using the version selector at the top of this page.\n\nTo use a specific API version, you can pass the `cdf-version: $version` header along with your requests to the API.\n\n## Beta versions\nThe beta versions provide a preview of what the stable version will look like in the future.\nBeta versions contain functionality that is reasonably mature, and highly likely to become a part of the stable API.\n\nBeta versions are indicated by a `-beta` suffix after the version name. For example, the beta version header for the\n2023-01-01 version is then `cdf-version: 20230101-beta`.\n\n## Alpha versions\nAlpha versions contain functionality that is new and experimental, and not guaranteed to ever become a part of the stable API.\nThis functionality presents no guarantee of service, so its use is subject to caution.\n\nAlpha versions are indicated by an `-alpha` suffix after the version name. For example, the alpha version header for\nthe 2023-01-01 version is then `cdf-version: 20230101-alpha`."
version: v1
contact:
name: Cognite Support
url: https://support.cognite.com
email: support@cognite.com
servers:
- url: https://{cluster}.cognitedata.com/api/v1/projects/{project}
description: The URL for the CDF cluster to connect to
variables:
cluster:
enum:
- api
- az-tyo-gp-001
- az-eastus-1
- az-power-no-northeurope
- westeurope-1
- asia-northeast1-1
- gc-dsm-gp-001
default: api
description: The CDF cluster to connect to
project:
default: publicdata
description: The CDF project name.
security:
- oidc-token:
- https://{cluster}.cognitedata.com/.default
- oauth2-client-credentials:
- https://{cluster}.cognitedata.com/.default
- oauth2-open-industrial-data:
- https://api.cognitedata.com/.default
- oauth2-auth-code:
- https://{cluster}.cognitedata.com/.default
tags:
- name: Geospatial
description: 'The Geospatial API allows to model a problem domain when data has a geometric or geographic nature.
The geospatial data is organized in feature types that are homogeneous collections of features (geospatial items), each having the same spatial representation, such as points, lines, or polygons, and a common set of typed properties. The Geospatial API is aware of Coordinate Reference Systems, and allows transformations.
To learn more about geospatial concepts, see the [concept guide](https://developer.cognite.com/dev/concepts/resource_types/geospatial.html).'
paths:
/geospatial/crs:
get:
tags:
- Geospatial
summary: List Coordinate Reference Systems
description: '
> **Required capabilities:** `geospatialCrsAcl:READ`
List the defined Coordinate Reference Systems. The list can be limited to the custom Coordinate Reference Systems defined for the tenant.'
operationId: listGeospatialCoordinateReferenceSystems
parameters:
- $ref: '#/components/parameters/geospatialFilterOnlyCustom'
responses:
'200':
$ref: '#/components/responses/GeospatialCoordinateReferenceSystemResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialCrsAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'const allCRS = await client.geospatial.crs.list({ filterOnlyCustom : true });'
post:
tags:
- Geospatial
summary: Create Coordinate Reference Systems
description: '
> **Required capabilities:** `geospatialCrsAcl:WRITE`
Creates custom Coordinate Reference Systems.'
operationId: createGeospatialCoordinateReferenceSystems
requestBody:
description: List of custom Coordinate Reference Systems to be created.
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialCustomCoordinateReferenceSystemSpecs'
examples:
GeospatialCreateCoordinateReferenceSystemsExample:
$ref: '#/components/examples/GeospatialCreateCoordinateReferenceSystemsExample'
required: true
responses:
'201':
$ref: '#/components/responses/GeospatialCustomCoordinateReferenceSystemResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialCrsAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const crsToCreate = [{\n srid: 456789,\n wkt: 'GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]]',\n projString: '+proj=longlat +datum=WGS84 +no_defs \\\"\\\"'\n }];\n\nconst createdCRS = await client.geospatial.crs.create(crsToCreate);"
/geospatial/crs/byids:
post:
tags:
- Geospatial
summary: Get Coordinate Reference Systems
description: '
> **Required capabilities:** `geospatialCrsAcl:READ`
Get Coordinate Reference Systems by their Spatial Reference IDs'
operationId: getCoordinateReferenceSystem
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialReferenceIds'
examples:
CoordinateReferenceSystemRequestExample:
$ref: '#/components/examples/GeospatialCoordinateReferenceSystemRequestExample'
responses:
'200':
$ref: '#/components/responses/GeospatialCoordinateReferenceSystemResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialCrsAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'const retrievedCRS = await client.geospatial.crs.retrieve([{ srid: 4326 }]);'
/geospatial/crs/delete:
post:
tags:
- Geospatial
summary: Delete Coordinate Reference Systems
description: '
> **Required capabilities:** `geospatialCrsAcl:WRITE`
Delete custom Coordinate Reference Systems.'
operationId: deleteGeospatialCoordinateReferenceSystems
requestBody:
description: List of custom Coordinate Reference Systems to be deleted.
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialReferenceIds'
examples:
CoordinateReferenceSystemRequestExample:
$ref: '#/components/examples/GeospatialCoordinateReferenceSystemRequestExample'
responses:
'200':
$ref: '#/components/responses/EmptyResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialCrsAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'await client.geospatial.crs.delete([{ srid: 4326}]);'
/geospatial/featuretypes:
post:
tags:
- Geospatial
summary: Create feature types
description: '
> **Required capabilities:** `geospatialAcl:WRITE`
Creates feature types. Each tenant can have up to 100 feature types.'
operationId: createFeatureTypes
requestBody:
description: List of feature types to be created. It is possible to create up to 100 feature types in one request provided the total number of feature types on the tenant will not exceed 100.
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureTypeSpecs'
examples:
GeospatialFeatureTypesRequestExample:
$ref: '#/components/examples/GeospatialFeatureTypesRequestExample'
required: true
responses:
'201':
$ref: '#/components/responses/GeospatialFeatureTypesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const featureTypes = [\n {\n externalId: 'ocean_temperature',\n properties: { temperature: { type: 'DOUBLE' as const }, location: { type: 'POINT' as const, srid: 4326 } } ,\n searchSpec: { location_idx: { properties : ['location'] } }\n }\n];\nconst createdFeatureTypes = await client.geospatial.featureType.create(featureTypes);"
/geospatial/featuretypes/byids:
post:
tags:
- Geospatial
summary: Retrieve feature types
description: '
> **Required capabilities:** `geospatialAcl:READ`
Retrieves feature types by external ids. It is possible to retrieve up to 100 items per request, i.e. the maximum number of feature types for a tenant.'
operationId: getFeatureTypesByIds
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureTypeExternalIds'
examples:
ExternalIdsExample:
$ref: '#/components/examples/GeospatialFeatureTypeExternalIdsExample'
required: true
responses:
'200':
$ref: '#/components/responses/GeospatialFeatureTypesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'const retrievedFeatureTypes = await client.geospatial.featureType.retrieve([ { externalId: ''ocean_temperature'' } ]);'
/geospatial/featuretypes/list:
post:
tags:
- Geospatial
summary: List feature types
description: '
> **Required capabilities:** `geospatialAcl:READ`
List all feature types'
operationId: listFeatureTypes
responses:
'200':
$ref: '#/components/responses/GeospatialFeatureTypesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: const allFeatureTypes = await client.geospatial.featureType.list();
/geospatial/featuretypes/update:
post:
tags:
- Geospatial
summary: Update feature types
description: '
> **Required capabilities:** `geospatialAcl:READ` `geospatialAcl:WRITE`
Update one or more feature types'
operationId: updateFeatureTypes
requestBody:
description: 'List of feature types to be updated. It is possible to add and remove properties and indexes. WARNING: removing properties will result in data loss in corresponding features.'
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialUpdateFeatureTypeSpecs'
examples:
GeospatialFeatureTypesUpdateRequestExample:
$ref: '#/components/examples/GeospatialFeatureTypesUpdateRequestExample'
required: true
responses:
'200':
$ref: '#/components/responses/GeospatialFeatureTypesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
- geospatialAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const featureTypesToUpdate = [\n {\n externalId: 'ocean_temperature',\n update: {\n properties: { add: { depth: { type: 'DOUBLE'} }, remove: ['temperature'] },\n searchSpec: { add: { depth_idx: { properties: ['depth'] } } }\n }\n }\n];\nconst updatedFeatureTypes = await client.geospatial.featureType.update(featureTypesToUpdate);"
/geospatial/featuretypes/delete:
post:
tags:
- Geospatial
summary: Delete feature types
description: '
> **Required capabilities:** `geospatialAcl:WRITE`
Delete feature types.'
operationId: GeospatialDeleteFeatureTypes
requestBody:
description: List of feature types to be deleted. It is possible to delete a maximum of 10 feature types per request. Feature types must not have related features. Feature types with related features can be deleted using force flag.
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialDeleteFeatureType'
examples:
ExternalIdsExample:
$ref: '#/components/examples/GeospatialFeatureTypeExternalIdsExample'
required: true
responses:
'200':
$ref: '#/components/responses/EmptyResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'await client.geospatial.featureType.delete([{ externalId: ''ocean_temperature''}], { recursive : true });'
/geospatial/featuretypes/{featureTypeExternalId}/features:
post:
tags:
- Geospatial
summary: Create features
description: '
> **Required capabilities:** `geospatialAcl:READ` `geospatialAcl:WRITE`
Create features'
operationId: createFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureSpecs'
examples:
GeospatialFeaturesRequestExample:
$ref: '#/components/examples/GeospatialFeaturesRequestExample'
required: true
responses:
'201':
$ref: '#/components/responses/GeospatialFeaturesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
- geospatialAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const featureTypeExternalId = 'ocean_temperature';\nconst features = [\n { externalId: 'measurement_point_765', temperature: 5.65, location: { wkt: 'POINT(60.547602 -5.423433)' }},\n { externalId: 'measurement_point_863', temperature: 5.03, location: { wkt: 'POINT(60.585858 -6.474416)' }},\n];\nconst createdFeatures = await client.geospatial.feature.create(featureTypeExternalId, features);"
get:
tags:
- Geospatial
summary: Get features
description: '
> **Required capabilities:** `geospatialAcl:READ`
Get features with paging support'
operationId: getFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
- $ref: '#/components/parameters/Cursor'
- in: query
name: limit
schema:
$ref: '#/components/schemas/SearchLimit'
- in: query
name: allowCrsTransformation
schema:
$ref: '#/components/schemas/GeospatialAllowCrsTransformation'
- in: query
name: allowDimensionalityMismatch
schema:
$ref: '#/components/schemas/GeospatialAllowDimensionalityMismatch'
responses:
'200':
$ref: '#/components/responses/GeospatialFeaturesWithCursorResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
/geospatial/featuretypes/{featureTypeExternalId}/features/list:
post:
tags:
- Geospatial
summary: Filter all features
description: '
> **Required capabilities:** `geospatialAcl:READ`
List features based on the feature property filter passed in the body of the request. This operation supports pagination by cursor.'
operationId: listFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureListRequest'
examples:
GeospatialFeatureExternalIdsExample:
$ref: '#/components/examples/GeospatialListExample'
required: true
responses:
'200':
$ref: '#/components/responses/GeospatialFeaturesWithCursorResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const params = {\n filter: {\n and: [\n { range:{ property: 'temperature', gt:4.54 } },\n { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n ]\n },\n};\n\nconst allFeaturesList = await client.geospatial.feature.list('ocean_temperature', params);"
/geospatial/featuretypes/{featureTypeExternalId}/features/byids:
post:
tags:
- Geospatial
summary: Retrieve features
description: '
> **Required capabilities:** `geospatialAcl:READ`
Retrieves features by external ids. It is possible to retrieve up to 1000 items per request.'
operationId: getFeaturesByIds
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureIdsWithOutput'
examples:
GeospatialFeatureExternalIdsExample:
$ref: '#/components/examples/GeospatialFeatureExternalIdsExample'
required: true
responses:
'200':
$ref: '#/components/responses/GeospatialFeaturesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'const featuresToRetrieve = [{ externalId: ''measurement_point_765'' }, { externalId: ''measurement_point_765'' }];
const outputParams = { output: { geometryFormat: ''GEOJSON'' as const } };
const retrievedFeatures = await client.geospatial.feature.retrieve(''ocean_temperature'', featuresToRetrieve, outputParams);'
/geospatial/featuretypes/{featureTypeExternalId}/features/update:
post:
tags:
- Geospatial
summary: Update features
description: '
> **Required capabilities:** `geospatialAcl:READ` `geospatialAcl:WRITE`
Update features. This is a replace operation, i.e., all feature properties have to be sent in the request body even if their values do not change.'
operationId: updateFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
description: List of features to update.
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureSpecs'
examples:
GeospatialFeaturesRequestExample:
$ref: '#/components/examples/GeospatialFeaturesRequestExample'
required: true
responses:
'200':
$ref: '#/components/responses/GeospatialFeaturesResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
- geospatialAcl:WRITE
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: 'const featuresToDelete = [{ externalId: ''measurement_point_765'' }, { externalId: ''measurement_point_765'' }];
await client.geospatial.feature.delete(''ocean_temperature'', featuresToDelete);
const featuresToUpdate = [
{ externalId: ''measurement_point_765'', temperature: 5.65, location: { wkt: ''POINT(60.547602 -5.423433)'' } },
{ externalId: ''measurement_point_863'', temperature: 5.03, location: { wkt: ''POINT(60.585858 -6.474416)'' } }
];
const updatedFeatures = await client.geospatial.feature.update(''ocean_temperature'', featuresToUpdate);'
/geospatial/featuretypes/{featureTypeExternalId}/features/delete:
post:
tags:
- Geospatial
summary: Delete features
description: '
> **Required capabilities:** `geospatialAcl:READ` `geospatialAcl:WRITE`
Delete features.'
operationId: deleteFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
description: List of features to be deleted. It is possible to post a maximum of 1000 items per request.
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureIds'
examples:
GeospatialFeatureExternalIdsExample:
$ref: '#/components/examples/GeospatialFeatureExternalIdsExample'
required: true
responses:
'200':
$ref: '#/components/responses/EmptyResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
- geospatialAcl:WRITE
/geospatial/featuretypes/{featureTypeExternalId}/features/search:
post:
tags:
- Geospatial
summary: Search features
description: '
> **Required capabilities:** `geospatialAcl:READ`
Search for features based on the feature property filter passed in the body of the request. The result of the search is limited to a maximum of 1000 items. Results in excess of the limit are truncated. This means that the complete result set of the search cannot be retrieved with this method. However, for a given unmodified feature collection, the result of the search is deterministic and does not change over time.'
operationId: searchFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureSearchRequest'
examples:
GeospatialSearchExample:
$ref: '#/components/examples/GeospatialSearchExample'
responses:
'200':
$ref: '#/components/responses/GeospatialFeatureSearchResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const params = {\n filter: {\n and: [\n { range:{ property: 'temperature', gt:4.54 } },\n { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n ]\n },\n limit: 100,\n sort: [ 'temperature:ASC','location']\n};\n\nconst searchedFeatures = await client.geospatial.feature.search('ocean_temperature', params);"
/geospatial/featuretypes/{featureTypeExternalId}/features/search-streaming:
post:
tags:
- Geospatial
summary: Search and stream features
description: '
> **Required capabilities:** `geospatialAcl:READ`
Search for features based on the feature property filter passed in the body of the request. The streaming response format can be length prefixed, new line delimited, record separator delimited or concatenated depending on requested output (see https://en.wikipedia.org/wiki/JSON_streaming).'
operationId: searchFeaturesStreaming
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureSearchStreamingRequest'
examples:
GeospatialSearchStreamingExample:
$ref: '#/components/examples/GeospatialSearchStreamingExample'
responses:
'200':
$ref: '#/components/responses/GeospatialFeatureSearchStreamingResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const params = {\n filter: {\n and: [\n { range:{ property: 'temperature', gt:4.54 } },\n { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n ]\n },\n limit: 100,\n output: { jsonStreamFormat: 'NEW_LINE_DELIMITED' as const }\n};\n\nconst featureStreamString = await client.geospatial.feature.searchStream('ocean_temperature', params);"
/geospatial/featuretypes/{featureTypeExternalId}/features/aggregate:
post:
tags:
- Geospatial
summary: Aggregate features
description: '
> **Required capabilities:** `geospatialAcl:READ`
Search for features based on the feature property filter and perform requested aggregations on a given property. Aggregations are supported for all filters that do not contain `stWithin`, `stWithinProperly`, `stContains` and `stContainsProperly` search in 3D geometries.'
operationId: aggregateFeatures
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialFeatureAggregateRequest'
examples:
FeatureAggregateExample:
$ref: '#/components/examples/GeospatialFeatureAggregateExample'
responses:
'200':
$ref: '#/components/responses/GeospatialFeatureAggregateResponse'
'400':
$ref: '#/components/responses/GeospatialErrorResponse'
x-capability:
- geospatialAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const aggregateParams = {\n filter: {\n and: [\n { range:{ property: 'temperature', gt:4.54 } },\n { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n ]\n },\n property: 'temperature',\n aggregates: ['min', 'max', 'average'],\n groupBy: ['category']\n};\n\nconst featureStream = await client.geospatial.feature.searchStream('ocean_temperature', aggregateParams);"
/geospatial/compute:
post:
tags:
- Geospatial
summary: Compute
description: '
> **Required capabilities:** `geospatialAcl:READ` `geospatialCrsAcl:READ`
Compute custom json output structures or well known binary format responses based on calculation or selection of feature properties or direct values given in the request.'
operationId: compute
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GeospatialComputeRequest'
examples:
StTransformGeometryExample:
$ref: '#/components/examples/GeospatialComputeRequestExample'
responses:
'200':
$ref: '#/components/responses/GeospatialComputeResponse'
x-capability:
- geospatialAcl:READ
- geospatialCrsAcl:READ
x-code-samples:
- lang: JavaScript
label: JavaScript SDK
source: "const response = await client.geospatial.compute.compute({\n output: {\n \"output\": {\n stTransform: {\n geometry: {\n ewkt: \"SRID=4326;POLYGON((0 0,10 0,10 10,0 10,0 0))\"\n },\n srid: 4326,\n }\n }\n }\n});"
/geospatial/featuretypes/{featureTypeExternalId}/features/{featureExternalId}/rasters/{rasterPropertyName}:
put:
tags:
- Geospatial
summary: Put a raster into a feature property
description: '
> **Required capabilities:** `geospatialAcl:READ` `geospatialAcl:WRITE`
Put a raster into a feature property. The feature property must be of type RASTER.'
operationId: putRaster
parameters:
- $ref: '#/components/parameters/geospatialFeatureTypeExternalId'
- $ref: '#/components/parameters/geospatialFeatureExternalId'
- $ref: '#/components/parameters/geospatialRasterPropertyName'
- $ref: '#/compo
# --- truncated at 32 KB (91 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/cognite/refs/heads/main/openapi/cognite-geospatial-api-openapi.yml