cgal_union_polygon - ObjectVision/GeoDMS GitHub Wiki
Geometric functions > cgal_union_polygon
- cgal_union_polygon(polygon_data_item)
- cgal_union_polygon(polygon_data_item, partition_attribute)
cgal_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).
cgal_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 cgal_ prefix of the function name indicates that the implementation of the operator uses CGAL, which provides exact predicates and exact constructions for maximum numerical precision.
- 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.
14.0
// Dissolve all districts into one polygon
parameter<dpoint> country_geometry := cgal_union_polygon(district/geometry);
// Dissolve districts grouped by province
attribute<dpoint> province_geometry (province) := cgal_union_polygon(district/geometry, district/province_rel);