geos_overlay_polygon
Geometric functions > geos_overlay_polygon
syntax
- geos_overlay_polygon(polygon_data_item)
- geos_overlay_polygon(polygon_data_item1, polygon_data_item2)
description
geos_overlay_polygon computes the spatial overlay between polygon sets, resulting in a new domain containing all intersecting polygon pairs with their combined geometry.
With one argument, geos_overlay_polygon(polygon_data_item) computes a self-overlay: all pairs of polygons within the dataset that spatially overlap are found and their intersection geometries are computed.
With two arguments, geos_overlay_polygon(polygon_data_item1, polygon_data_item2) computes an overlay between two polygon datasets. All pairs of polygons from the two datasets that spatially overlap are found and their intersection geometries are computed.
The geos_ prefix of the function name indicates that the implementation of the operator uses geos.
applies to
- attribute polygon_data_item1 with a polygon value type
- attribute polygon_data_item2 (optional) with a polygon value type, compatible with polygon_data_item1
conditions
- The composition type of the arguments needs to be polygon.
- The value types of both arguments must be compatible (same point type).
result
The result is a container (new domain unit of type uint32) with:
geometry: the intersection polygon geometry for each overlapping pairfirst_rel: relation to the domain of polygon_data_item1 (absent if domain is void)second_rel: relation to the domain of polygon_data_item2 (absent if domain is void, or in 1-argument form)
since version
14.0
example
unit<uint32> overlay := geos_overlay_polygon(land_use/geometry, district/geometry)
{
attribute<fpoint> geometry;
attribute<land_use> first_rel;
attribute<district> second_rel;
}