cgal_split_polygon - ObjectVision/GeoDMS GitHub Wiki
Geometric functions > cgal_split_polygon
- cgal_split_polygon(polygon_data_item)
cgal_split_polygon(polygon_data_item) splits each multi-polygon element in the polygon_data_item into its individual single-polygon parts. The result is a new domain unit containing one entry per single polygon, with a geometry sub-item holding the polygon geometries and a polygon_rel sub-item that relates each result polygon back to its source element in polygon_data_item.
This operator is useful when polygon data contains multi-part features (multi-polygons) and individual parts are needed as separate entities.
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
- 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).
The result is a container with:
-
geometry: polygon attribute with the individual single polygons -
polygon_rel: relation back to the domain of polygon_data_item
14.0
unit<uint32> single_parts := cgal_split_polygon(district/geometry)
{
attribute<dpoint> geometry;
attribute<district> polygon_rel;
}