Spatial Operations and Proportional Calculation - Precisely Data Integrity Suite

Data Integrity Suite APIs

Product
Data_Integrity
Spatial_Analytics
Data_Enrichment
geo_addressing_1
Services
Spatial Analytics
Data Enrichment
Geo Addressing
ft:title
Data Integrity Suite APIs
ft:locale
en-US
PublicationType
pt_developer
copyrightfirst
2023
copyrightlast
2026

Spatial Operations

The Spatial Summary API supports two spatial operations: INTERSECTS and WITHIN. These operations define how the API selects spatial geometries from the spatial table based on the input geometry.

  • INTERSECTS: returns geometries in the spatial table that intersect with the input geometry.
  • WITHIN: returns geometries that are entirely contained within the input geometry.

Example - Polygon Geometry

Results where spatial table has polygon geometries
Intersects Within Proportional Intersects

100% of numeric data from the selected features are used in the summarize calculation.

Intersects

100% of numeric data from the selected features are used in the summarize calculation.

Within

Numeric data is multiplied by the percentage of the intersecting area of selected features to input polygon.

Proportional Intersects
Note: If the selected geometry is polygon, area based apportionment is applied.

Example - Polyline Geometry

Results where spatial table has line geometries
Intersects Within Proportional Intersects

100% of numeric data from the selected features is used in the summarize calculation.

(each colour is a separate line feature)Intersects

100% of numeric data from the selected features is used in the summarize calculation.

Within

Numeric data is multiplied by the percentage of the intersecting length of selected features to input polygon.

Proportional Intersects
Note: If the selected geometry is line, length based apportionment is applied.

Proportional Calculation

The proportionalCalculation parameter defines how numeric values are aggregated during an INTERSECTS operation. This parameter can be set to true or false (default is false)

  • When set to true, the API calculates the percentage of the intersecting geometry (polygon area or line length) relative to the original input geometry.
  • It then applies this percentage to numerical values before calculating aggregates such as minimum, maximum, average, or sum.
  • When set to false, the aggregates such as minimum, maximum, average, or sum are calculated on the full value of the numerical columns, regardless of the extent of intersection.

This option is useful when you need to proportionally apportion values—such as population within postal codes—based on the input geometry.

Note: Proportional calculation is not supported for the WITHIN operation as it always returns entire polygon geometries.

Examples

Case 1: Intersects

{
    "spatialOperation": "INTERSECTS",
    "tableName": "flr_usa_comm",
    "geometryType": "WKT",
    "geometry": "POLYGON ((-122.758738137637 37.9425625657615,-122.615019033612 37.9425625657615, -122.615019033612 37.8651544031703, -122.758738137637 37.8651544031703, -122.758738137637 37.9425625657615))",
    "aggregateColumns": {
        "id": ["min","max","avg","sum"]
    }
}
Results - Intersects
Intersects
{
    "summary": {
        "id_MIN": 30918,
        "id_MAX": 31041,
        "id_AVG": 30937.917,
        "id_SUM": 371255.0,
        "count": 12
    }
}               

Case 2: Intersects with proportional Calculation parameter set as 'true'

{
    "spatialOperation": "INTERSECTS",
    "tableName": "flr_usa_comm",
    "geometryType": "WKT",
    "geometry": "POLYGON ((-122.758738137637 37.9425625657615, -122.615019033612 37.9425625657615, -122.615019033612 37.8651544031703, -122.758738137637 37.8651544031703, -122.758738137637 37.9425625657615))",
    "aggregateColumns": {
        "id": ["min","max","avg","sum"]
    },
    "proportionalCalculation": true
}     
Results - Intersects (Proportional Calculation set as 'true')
Proportional Intersects
{
    "summary": {
        "id_MIN": 102.90065719329732,
        "id_MAX": 30925.99999999998,
        "id_AVG": 15463.648538597992,
        "id_SUM": 185563.78,
        "count": 12
    }
}              

Case 3: Within

{
    "spatialOperation": "WITHIN",
    "tableName": "flr_usa_comm",
    "geometryType": "WKT",
    "geometry": "POLYGON ((-122.758738137637 37.9425625657615, -122.615019033612 37.9425625657615, -122.615019033612 37.8651544031703, -122.758738137637 37.8651544031703, -122.758738137637 37.9425625657615))",
    "aggregateColumns": {
        "id": ["min","max","avg","sum"]
    }
}     
Results - Within
Within
{
    "summary": {
        "id_MIN": 30922,
        "id_MAX": 30926,
        "id_AVG": 30924.0,
        "id_SUM": 154620.0,
        "count": 5
    }
}