bp_split_polygon

geometric-functions bp_split_polygon

syntax

  • bp_split_polygon(polygon_data_item)

description

bp_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. This data item is a copy of the nr_OrgEntity but with a name that meets our naming-conventions. The nr_OrgEntity argument is still generated for backward compatibility.

conditions

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

This function results in problems for (integer) coordinates larger than 2^25 (after translation where the first point is moved to (0, 0)). If your integer coordinates, for instance, represent mm, 2^25[mm] = about 33 [km]. The reason is that for calculating intersections, products of coordinates are calculated and cast to float64 with a 53-bit mantissa (in the development/test environment of boost::polygon, these were float80 values with a 64-bit mantissa). We advise you to keep the size of your integer coordinates for polygons limited and, for instance, do not use an mm precision for country borders (a meter or kilometre might be sufficient).

function type

  • bp_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 := bp_split_polygon(geometry);

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

see also