import { BaseResourceAPI, CogniteExternalId, ExternalId } from '@cognite/sdk-core'; import { FeatureAggregateParams, GeospatialFeature, GeospatialFeatureListFilter, GeospatialFeatureResponse, GeospatialFeatureSearchFilter, GeospatialFeatureSearchStreamFilter, GeospatialFeatureSearchStreamResponse, GeospatialOutput } from './types'; export declare class FeatureAPI extends BaseResourceAPI { /** * [Create features](https://docs.cognite.com/api/v1/#operation/createFeatures) * * ```js * const featureTypeExternalId = 'ocean_temperature'; * const features = [ * { 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 createdFeatures = await client.geospatial.feature.create(featureTypeExternalId, features); * ``` */ create: (featureTypeExternalId: CogniteExternalId, features: GeospatialFeature[]) => Promise; /** * [Retrieve features](https://docs.cognite.com/api/v1/#operation/getFeaturesByIds) * * ```js * 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); * ``` */ retrieve: (featureTypeExternalId: CogniteExternalId, externalIds: ExternalId[], params?: GeospatialOutput) => Promise; /** * [Update features](https://docs.cognite.com/api/v1/#operation/updateFeatures) * * ```js * 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); * ``` */ update: (featureTypeExternalId: CogniteExternalId, changes: GeospatialFeature[]) => Promise; /** * [Update features](https://docs.cognite.com/api/v1/#operation/updateFeatures) * * ```js * const featuresToDelete = [{ externalId: 'measurement_point_765' }, { externalId: 'measurement_point_765' }]; * * await client.geospatial.feature.delete('ocean_temperature', featuresToDelete); * ``` */ delete: (featureTypeExternalId: CogniteExternalId, externalIds: ExternalId[]) => Promise<{}>; /** * [Search features](https://docs.cognite.com/api/v1/#operation/searchFeatures) * * ```js * const params = { * filter: { * and: [ * { range:{ property: 'temperature', gt:4.54 } }, * { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } } * ] * }, * limit: 100, * sort: [ 'temperature:ASC','location'] * }; * * const searchedFeatures = await client.geospatial.feature.search('ocean_temperature', params); * ``` */ search: (featureTypeExternalId: CogniteExternalId, params?: GeospatialFeatureSearchFilter) => Promise; /** * [Search and stream features](https://docs.cognite.com/api/v1/#operation/searchFeaturesStreaming) * * ```js * const params = { * filter: { * and: [ * { range:{ property: 'temperature', gt:4.54 } }, * { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } } * ] * }, * limit: 100, * output: { jsonStreamFormat: 'NEW_LINE_DELIMITED' as const } * }; * * const featureStreamString = await client.geospatial.feature.searchStream('ocean_temperature', params); * ``` */ searchStream: (featureTypeExternalId: CogniteExternalId, params?: GeospatialFeatureSearchStreamFilter) => Promise; /** * [Aggregate features](https://docs.cognite.com/api/v1/#operation/aggregateFeatures) * * ```js * const aggregateParams = { * filter: { * and: [ * { range:{ property: 'temperature', gt:4.54 } }, * { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } } * ] * }, * property: 'temperature', * aggregates: ['min', 'max', 'average'], * groupBy: ['category'] * }; * * const featureStream = await client.geospatial.feature.searchStream('ocean_temperature', aggregateParams); * ``` */ aggregate: (featureTypeExternalId: CogniteExternalId, params?: FeatureAggregateParams) => Promise; /** * [List features](https://docs.cognite.com/api/v1/#tag/Geospatial/operation/listFeatures) * * ```js * const params = { * filter: { * and: [ * { range:{ property: 'temperature', gt:4.54 } }, * { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } } * ] * }, * }; * * const allFeaturesList = await client.geospatial.feature.list('ocean_temperature', params); * ``` */ list: (featureTypeExternalId: CogniteExternalId, filterParams?: GeospatialFeatureListFilter) => import('@cognite/sdk-core').CursorAndAsyncIterator; }