bg_split_polygon

geometric-functions bg_split_polygon

syntax

  • bg_split_polygon(polygon_data_item)

description

bg_split_polygon(polygon_data_item) results in a new uint32 domain-unit with single polygons for each (multi)polygon in the polygon_data_item argument.

If the original polygon_data_item only contains single polygons, the resulting domain unit has the same number of elements as the domain unit of the polygon_data_item argument.

The figure illustrates a source polygon_data_item (left image) of a domain unit with four entries.

Each colour represents an entry in the polygon_data_item; the red and green areas are multipolygons.

The resulting domain unit of the split_polygon function for this polygon_data_item will contain seven entries, with a single polygon for each entry (right image).

The split_polygon functions generate two (and since GeoDMS 8) three subitems:

  • geometry: the geometry of the single polygons. This attribute has the same values-unit as the polygon_data_item argument.
  • polygon_rel: a relation for the new domain towards the domain of the polygon_data_item argument.

conditions

  1. The composition type of the polygon_data_item argument needs to be a polygon with an ipoint, spoint, fpoint, or dpoint value-type.
  2. The domain unit of the polygon_data_item argument must be of value type uint32.

function type

  • bg_split_polygon(D->P) -> S { geometry: S->P; polygon_rel: S->D }

where P is a GeoDms point type with signed integer coordinates, i.e. 16, 32, or 64-bit signed integers. S is the resulting uint32 set of split polygons, and D is the domain of the argument.

since version

15.6.0

example

unit<uint32> split_polygons := bg_split_polygon(geometry);

The number of resulting entries is based on the number of null coordinates plus 1.

see also