Skip to content

dms_union_polygon

MaartenHilferink edited this page Sep 6, 2026 · 2 revisions

Geometric functions dms_union_polygon

syntax

  • dms_union_polygon(polygon_data_item)
  • dms_union_polygon(polygon_data_item, partition_attribute)

description

dms_union_polygon(polygon_data_item) dissolves every polygon of the argument into one value: the union of them all, as a parameter with a void domain.

dms_union_polygon(polygon_data_item, partition_attribute) dissolves per group. Polygons that share a partition value are merged, and the result has one element per value of the partition attribute's values unit. This is the dissolve by attribute of GIS terminology.

Unlike the four library variants, the elements do not have to be valid polygons: each is read under the even-odd rule of the dms polygon operators family, so a source with self-intersecting rings, flipped holes or unclosed rings dissolves without a repair pass. A dissolve of an invalid element with a valid one is well defined, which is what the family exists for.

The union is folded pairwise, so the work grows with the number of elements rather than with their square, and every reduction of one call snaps to the same grid, which keeps the answer independent of the order the fold happened to take.

applies to

conditions

  1. The composition type of the polygon_data_item needs to be polygon.
  2. A partition_attribute, when given, must have the same domain as polygon_data_item.

since version

20.20.0

example

parameter<ipoint>  country  (polygon) := dms_union_polygon(municipality/geometry);
attribute<ipoint>  province (province, polygon) := dms_union_polygon(municipality/geometry, municipality/province_rel);

see also

Clone this wiki locally