geos_union_polygon - ObjectVision/GeoDMS GitHub Wiki

Geometric functions > geos_union_polygon

syntax

  • geos_union_polygon(polygon_data_item)
  • geos_union_polygon(polygon_data_item, partition_attribute)

description

geos_union_polygon(polygon_data_item) dissolves all polygons in the polygon_data_item into a single polygon by computing the union of all elements. The result has a void domain (one geometry per configuration).

geos_union_polygon(polygon_data_item, partition_attribute) dissolves polygons grouped by the partition_attribute. Polygons sharing the same partition value are merged together. The result has a domain derived from the values unit of the partition_attribute.

This is equivalent to a "dissolve by attribute" operation in GIS terminology.

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_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.

since version

14.0

example

// Dissolve all districts into one polygon
parameter<dpoint> country_geometry := geos_union_polygon(district/geometry);

// Dissolve districts grouped by province
attribute<dpoint> province_geometry (province) := geos_union_polygon(district/geometry, district/province_rel);

see also

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