Aggregate features

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.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
path Parameters
featureTypeExternalId
required
string <= 32 characters ^[A-Za-z][A-Za-z0-9_]{0,31}$

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

Example: ocean_measures
Request Body schema: application/json
allowDimensionalityMismatch
boolean (GeospatialAllowDimensionalityMismatch)

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.

GeospatialFeatureNotFilter (object) or GeospatialFeatureAndFilter (object) or GeospatialFeatureOrFilter (object) or GeospatialFeatureEqualsFilter (object) or GeospatialFeatureMissingFilter (object) or GeospatialFeatureLikeFilter (object) or GeospatialFeatureRegexFilter (object) or GeospatialFeatureRangeFilter (object) or GeospatialFeatureContainsAnyFilter (object) or GeospatialFeatureInFilter (object) or GeospatialFeatureStIntersectsFilter (object) or GeospatialFeatureStIntersects3dFilter (object) or GeospatialFeatureStWithinFilter (object) or GeospatialFeatureStWithinProperlyFilter (object) or GeospatialFeatureStContainsFilter (object) or GeospatialFeatureStContainsProperlyFilter (object) or GeospatialFeatureStWithinDistanceFilter (object) or GeospatialFeatureStWithinDistance3dFilter (object) (GeospatialFeatureFilter)
aggregates
Array of strings
Deprecated

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

Items Enum: "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 (GeospatialReferenceId) [ 0 .. 1000000 ]

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

groupBy
Array of strings

names of properties to be used for grouping by

sort
Array of strings

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.

object (GeospatialAggregateOutput)

A list of aggregations which are requested.

Responses
200

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

400

Failed request reponse.

post/geospatial/featuretypes/{featureTypeExternalId}/features/aggregate
Request samples
application/json
{
  • "filter": {
    • "and": [
      ]
    },
  • "groupBy": [
    • "category"
    ],
  • "sort": [
    • "average:ASC",
    • "category:DESC"
    ],
  • "output": {
    • "min_temperature": {
      },
    • "max_speed": {
      }
    }
}
Response samples
application/json
{
  • "items": [
    • {
      },
    • {
      }
    ]
}