Skip to main content
POST
/
geospatial
/
featuretypes
/
{featureTypeExternalId}
/
features
/
aggregate
JavaScript SDK
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);
{
  "items": [
    {
      "category": "first category",
      "max": 12.3,
      "min": 0.5,
      "average": 5.32
    },
    {
      "category": "second category",
      "max": 14.3,
      "min": 0.7,
      "average": 8.32
    }
  ]
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Path Parameters

featureTypeExternalId
string
required

External Id of the feature type provided by client. Must be unique among all feature type external ids within a CDF project.

Maximum string length: 32
Pattern: ^[A-Za-z][A-Za-z0-9_]{0,31}$
Example:

"ocean_measures"

Body

application/json

Feature Aggregation Request

allowDimensionalityMismatch
boolean

Optional parameter indicating if the spatial filter operators allow input geometries with a different dimensionality than the properties they are applied to. For instance, when set to true, if a feature type has a property of type POLYGONZM (4D), its features can be filtered using the stContains operator and a POLYGON (2D) value. This option defaults to false if not specified.

Example:

true

filter
object
aggregates
enum<string>[]
deprecated

This parameter is deprecated. Use output instead. Names of aggregate functions that are requested.

Available options:
avg,
count,
max,
min,
stCentroid,
stCollect,
stConvexHull,
stIntersection,
stUnion,
sum,
variance
property
string
deprecated

This parameter is deprecated. Use output instead. Property name.

outputSrid
integer

EPSG code, e.g. 4326. Only valid for geometry types. See https://en.wikipedia.org/wiki/Spatial_reference_system

Required range: 0 <= x <= 1000000
Example:

4326

groupBy
string[]

names of properties to be used for grouping by

sort
string[]

Sort result by the selected fields (properties or aggregates). Default sort order is ascending if not specified. Available sort direction: ASC, DESC, ASC_NULLS_FIRST, DESC_NULLS_FIRST, ASC_NULLS_LAST, DESC_NULLS_LAST.

output
object

A list of aggregations which are requested.

Response

The aggregate feature response. The present fields in the response body correspond to requested aggregations.

items
object[]
required
Last modified on April 23, 2026