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);
const featuresToDelete = [{ externalId: 'measurement_point_765' }, { externalId: 'measurement_point_765' }];
await client.geospatial.feature.delete('ocean_temperature', featuresToDelete);
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);
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);
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);
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);
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);
Aggregate features
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);