cgal_split_polygon - ObjectVision/GeoDMS GitHub Wiki

Geometric functions > cgal_split_polygon

syntax

  • cgal_split_polygon(polygon_data_item)

description

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.

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

result

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

since version

14.0

example

unit<uint32> single_parts := cgal_split_polygon(district/geometry)
{
    attribute<dpoint>   geometry;
    attribute<district> polygon_rel;
}

see also

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