bg_simplify_multi_polygon
geometric-functions bg_simplify_multi_polygon
syntax
- bg_simplify_multi_polygon(multi_polygon_data_item, simplifyfactor)
description
bg_simplify_multi_polygon(multi_polygon_data_item, simplifyfactor) results in a data-item with the geometry of the multi_polygon_data_item, in which the geometric structure is simplified. Near points are combined to a single point. What is near is configured with the simplifyfactor, a parameter indicating for which distance points are combined. No metric needs to be configured for the simplifyfactor, it is using the metric of the coordinate-system.
The bg_ prefix of the function name indicates that the implementation of operator uses boost geometry library, more specifically, the simplify function.
A variant bg_simplify_single_polygon with the same signature can be used to simplify single polygons.
applies to
- attribute multi_polygon_data_item with an point value-type
- parameter simplifyfactor with a float64 value type
conditions
- The composition type type of the multi_polygon_data_item item needs to be polygon.
- The order of points in the multi_polygon_data_item needs to be clockwise for exterior bounds and counter clockwise for holes in polygons (right-hand-rule).
This function may result in losing the adjacency of polygons and in overlapping polygons, as shown in the figure above. We advice to be careful with functions like point_in_polygon on the resulting geometries. If you want to simplify your polygons while maintaining the topology, use the poly-to-grid-to-(simplified)-polygon script.
since version
7.409
example
attribute<fpoint> geometry_simplified (polygon, city) := bg_simplify_multi_polygon(city/geometry, 10.0);