Union_polygon (dissolve)

Geometric functions union_polygon (dissolve)

The unprefixed name union_polygon is not an operator: an expression that uses it fails with an unknown-operator error. The boost polygon implementation of the dissolve is bp_union_polygon, with the same argument, so adding the bp_ prefix repairs such an expression. The other implementations are geos_union_polygon, bg_union_polygon, cgal_union_polygon and dms_union_polygon; see polygon operators for the choice between them.

syntax

  • union_polygon(polygon_data_item)

description

union_polygon(polygon_data_item) results in a Parameter with all polygons of the polygon_data_item, in which the lines between adjacent polygons are removed.

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

applies to

Attribute polygon_data_item with an ipoint or spoint Value type

conditions

  1. The composition type type of the polygon_data_item item needs to be polygon.
  2. The Domain unit of the polygon_data_item item must be of value type uint32.
  3. The order of points in the polygon_data_item needs to be clockwise for exterior bounds and counter clockwise 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 casted to float64 with a 53 bits mantissa (in the development/test environment of boost::polygon these were float80 values with a 64 bits mantissa). We advise to keep the size of your integer coordinates for polygons limited and for instance do not use a mm precision for country borders (meter or kilometer might be sufficient).

since version

7.042; removed in 20.7.0

performance

O(n * m * log m) where n = number of polygons and m = average number of vertices per polygon. The algorithm processes polygon edges and computes unions. Complex overlapping geometries increase processing time.

example

parameter<ipoint> geometry (polygon) := bp_union_polygon(ipolygon(District/geometry));

see also