---
title: "Summarize spatial data"
method: POST
path: "/v1/spatial/summarize"
tags: ["Spatial Analysis"]
---

# Summarize spatial data

`POST /v1/spatial/summarize`

## Request

- Base URL: `https://api.cloud.precisely.com`
- URL: `https://api.cloud.precisely.com/v1/spatial/summarize`
- Auth: one of:
  - `bearerAuth` (a scheme the document does not define)
  - `ApiKeyAuth` (a scheme the document does not define)

Aggregates numeric/date columns for features selected by a spatial query (INTERSECTS or WITHIN) against geometry or address input. Supports aggregate functions such as min, max, avg, sum, and median. For INTERSECTS, proportionalCalculation can apportion numeric values by overlap area/length before aggregation.

## Headers

- `X-Request-Id` string

## Request body

- SpatialSummarizationRequest
  - `tableName` string, required: Name of the table containing spatial data used by the operation.
  - `location` Location
    - `format` 'wkt' | 'geojson' | 'lonlat' | 'address': Format of the location input. Allowed values: WKT, GEOJSON, LonLat, Address. Default value is WKT.
    - `value` string, required: Input geometry or address value. Geometry coordinates must use EPSG:4326 (longitude, latitude).
    - `country` string: Country for address input. Mandatory when format is Address.
  - `attributeFilter` string: Optional scalar attribute filter expression using logical operators (AND/OR/NOT) and comparison operators such as =, <>, <, <=, >, >=, IS NULL, LIKE, BETWEEN, and IN.
  - `proportionalCalculation` boolean: Determines whether proportional calculations are applied. This is only applicable when spatialOperation is "intersects".
  - `spatialOperation` string: Type of spatial operation. Allowed values are intersects and within. Default value is "intersects".
  - `aggregateColumns` object, required: Columns to be aggregated and corresponding aggregation operations to be performed. Possible values are: min, max, avg, sum, median.
  - `bufferDistance` string: Distance by which the input geometry will be expanded. Supports positive values for all geometry types. Negative values are only supported for polygon geometries to create inward buffers.

## Response `200`

Successful retrieval of spatial operations and aggregates data

- SpatialOperationsResponse
  - `type` string: type: either Feature or FeatureCollection
  - `features` FeatureDto[]: List of features
    - `type` string: Type of geometry eg: Multipolygon, Polygon, Linestring
    - `properties` object: Map of attributes requested
    - `geometry` GeometryDto
      - `type` string: Coordinates describing geometry
      - `coordinates` unknown[]
        - unknown
      - `geometries` GeometryDtoObject[]
        - `type` string: Coordinates describing geometry
        - `coordinates` unknown[]
          - unknown
        - `geometries` GeometryDtoObject[]
  - `responseParameters` object: Additional response parameters
  - `Metadata` AttributeDefinitionDto[]: Metadata object describing the response fields
    - `name` string: Name of attribute name present in response
    - `type` string: Data type of attribute

## Other responses

- `400`: Invalid request
- `401`: Unauthorized: Invalid token
- `403`: Forbidden
- `429`: Too many requests
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/precisely/apis/feature-api.md) · [All operations](https://skmtc.dev/precisely/apis/feature-api/llms.txt) · [OpenAPI document](https://skmtc.dev/precisely/apis/feature-api/revisions/6dc26f89c0aa?raw)
