Spatial Analysis

Summarize spatial data

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.

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)

Headers

X-Request-Idstring

The X-Request-Id header is optional but helpful for tracking requests. It acts as a unique identifier for troubleshooting and debugging issues effectively. Maximum length: 38 characters.Example: e02f00d5-e3a9-4fd6-aen1-3e5451abee46

Request body

tableNamestring required

Name of the table containing spatial data used by the operation.

attributeFilterstring

Optional scalar attribute filter expression using logical operators (AND/OR/NOT) and comparison operators such as =, <>, <, <=, >, >=, IS NULL, LIKE, BETWEEN, and IN.

proportionalCalculationboolean

Determines whether proportional calculations are applied. This is only applicable when spatialOperation is "intersects".

spatialOperationstring

Type of spatial operation. Allowed values are intersects and within. Default value is "intersects".

aggregateColumnsobject required

Columns to be aggregated and corresponding aggregation operations to be performed. Possible values are: min, max, avg, sum, median.

bufferDistancestring

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.

Example request

{
  "tableName": "/risks/flood_risk",
  "location": {
    "format": "wkt",
    "value": "\"geometry\": \"POLYGON(((-96.8,30.5),(-97.7,30.5),\n(-97.7,29.9),(-96.8,29.9),(-96.8,30.5)))\"",
    "country": "USA"
  },
  "attributeFilter": "rms_err < 50",
  "proportionalCalculation": true,
  "spatialOperation": "intersects",
  "aggregateColumns": {
    "population": [
      "sum",
      "avg"
    ],
    "area": [
      "min",
      "max"
    ]
  },
  "bufferDistance": "\"100 m\""
}

Response

Successful retrieval of spatial operations and aggregates data

typestring

type: either Feature or FeatureCollection

responseParametersobject

Additional response parameters

Changes

No recorded changes to this operation across all 1 revision of this API.