Bg_simplify_linestring

Geometric functions bg_simplify_linestring

syntax

  • bg_simplify_linestring(arc_data_item, simplifyfactor)

description

bg_simplify_linestring(arc_data_item, simplifyfactor) results in a data item with the geometry of the arc_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 uses the Metric of the Coordinate system.

The bg_ prefix of the function name indicates that the implementation of the operator uses boost geometry library, more specifically, the simplify function.

applies to

Since GeoDMS 20.23.1 simplifyfactor must be a parameter with a defined value of 0 or more. An attribute with a value per element was accepted and the value of the first element applied to every element; it now stops with the tolerance must be a parameter. A negative or null value stops with the tolerance must be a defined value of 0 or more; before, a negative value gave an error of the geos library for the geos_ operators, and a null an undefined result for the bg_ operators.

conditions

  1. The composition type type of the arc_data_item item needs to be arc.
  2. The order of points in the arc_data_item needs to be clockwise for exterior bounds and counter clockwise for holes in polygons (right-hand-rule).

since version

8.031

performance

O(n * k) where n = number of arcs and k = average vertices per arc. Uses Douglas-Peucker algorithm. Output size depends on simplifyfactor relative to geometry detail.

example

attribute<fpoint> geometry_simplified (polygon, district) := bg_simplify_linestring(road/geometry, 10.0);

see also