geos_split_union_polygon - ObjectVision/GeoDMS GitHub Wiki
Geometric functions > geos_split_union_polygon
- geos_split_union_polygon(polygon_data_item)
- geos_split_union_polygon(polygon_data_item, partition_attribute)
geos_split_union_polygon is a combination of geos_union_polygon and geos_split_polygon. It first dissolves polygons (optionally grouped by a partition_attribute) and then splits any resulting multi-polygons into individual single-polygon parts.
Without a partition_attribute, all polygons are unioned into one geometry first, then split into their disconnected parts.
With a partition_attribute, polygons are first grouped and dissolved per group value, and then each group's result is split into individual parts. The result includes a part_rel attribute relating each output polygon back to the partition group.
The geos_ prefix of the function name indicates that the implementation of the operator uses geos.
Only dpoint (double precision) coordinates are fully supported for GEOS-based polygon operations. For fpoint coordinates a deprecation warning is issued; use bp_split_union_polygon instead.
- attribute polygon_data_item with a polygon value type
- attribute partition_attribute (optional) with a categorical value type, domain matching polygon_data_item
- The composition type of the polygon_data_item needs to be polygon.
- The order of points in the polygon_data_item needs to be clockwise for exterior bounds and counterclockwise for holes (right-hand-rule).
- When a partition_attribute is provided, its domain must match the domain of polygon_data_item.
The result is a container with:
-
geometry: polygon attribute with the individual single polygons -
polygon_relorpart_rel: relation back to the source domain or partition
14.0
// Union all, then split into disconnected parts
unit<uint32> parts := geos_split_union_polygon(district/geometry)
{
attribute<dpoint> geometry;
attribute<district> polygon_rel;
}
// Union by province, then split into parts per province
unit<uint32> province_parts := geos_split_union_polygon(district/geometry, district/province_rel)
{
attribute<dpoint> geometry;
attribute<province> part_rel;
}