bp_union_polygon

geometric-functions bp_union_polygon

syntax

description

bp_union_polygon(polygon_data_item, partitioning) results in an attribute with all polygons from polygon_data_item, grouped by the argument relation.

Lines between adjacent polygons within each group are removed.

The domain-unit of the resulting attribute is the values-unit of the relation.

In other GIS software, the term dissolve is often used for this operation.

conditions

  1. The composition type of the polygon_data_item item needs to be polygon with an ipoint or spoint value-type.
  2. The domain unit of the polygon_data_item item must be of value type uint32.
  3. The domain unit of arguments polygon_data_item and relation must match.
  4. The order of points in the polygon_data_item needs to be clockwise for exterior bounds and counterclockwise for holes in polygons (right-hand rule).

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_union_polygon(D->P) -> void->P
  • bp_union_polygon(D->P, part_rel: D->R) -> R->P

where P is a GeoDms point type with signed integer coordinates, i.e. 16, 32, or 64-bit signed integers, D is the domain of the argument, and R is the values unit of the partitioning part_rel.

since version

15.6.0

example

parameter<ipoint> geometry (polygon) := bp_union_polygon(ipolygon(district/geometry));
attribute<ipoint> geometry (polygon, region) := bp_union_polygon(ipolygon(district/geometry), district/region_rel);

see also