geos_split_union_polygon - ObjectVision/GeoDMS GitHub Wiki

Geometric functions > geos_split_union_polygon

syntax

  • geos_split_union_polygon(polygon_data_item)
  • geos_split_union_polygon(polygon_data_item, partition_attribute)

description

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.

applies to

conditions

  1. The composition type of the polygon_data_item needs to be polygon.
  2. The order of points in the polygon_data_item needs to be clockwise for exterior bounds and counterclockwise for holes (right-hand-rule).
  3. When a partition_attribute is provided, its domain must match the domain of polygon_data_item.

result

The result is a container with:

  • geometry: polygon attribute with the individual single polygons
  • polygon_rel or part_rel: relation back to the source domain or partition

since version

14.0

example

// 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;
}

see also

⚠️ **GitHub.com Fallback** ⚠️