cartagen.simplify_reumann_witkam

cartagen.simplify_reumann_witkam#

simplify_reumann_witkam(geometry, tolerance)#

Simplify a line or polygon using a directional distance-based selection.

This algorithm, proposed by Reumann and Witkam [1], performs a sequential line simplification by using a “corridor” or “tube” defined by the direction of the first segment. Unlike the Douglas-Peucker algorithm, which considers the line globally, Reumann-Witkam is a local, streaming-friendly filter that processes vertices in order.

The principle of the algorithm is to define a search pipe using the first two points of a segment. For all subsequent points, the perpendicular distance to the infinite line passing through this initial segment is calculated. As long as the points stay within the tolerance distance, they are marked for deletion. When a point falls outside the pipe, the current point becomes the new starting vertex, and a new pipe direction is established.

The algorithm is particularly efficient for reducing the density of points in datasets where the direction of the line is relatively constant, making it ideal for real-time thinning of trajectory data or GPS traces.

Parameters:
  • geometry (LineString, MultiLineString, Polygon, MultiPolygon, LinearRing) – The geometry to simplify.

  • tolerance (float) – The width (radius) of the search corridor. Points within this distance from the segment’s trajectory are removed. Higher values = fewer points kept (more aggressive simplification).

Returns:

LineString, MultiLineString, Polygon, MultiPolygon, LinearRing

See also

simplify_angular

Simplify a line or polygon by removing vertexes with small angles.

simplify_douglas_peucker

Simplify a line or polygon using a distance-based selection.

simplify_lang

Simplify a line or polygon using a look-ahead distance-based selection.

simplify_li_openshaw

Simplify a line or a polygon using a regular grid.

simplify_raposo

Simplify a line or a polygon using an hexagonal tessellation.

simplify_visvalingam_whyatt

Simplify a line or polygon using an area-based selection.

simplify_wang_muller

Simplify a line or polygon using a bend-reduction method.

simplify_whirlpool

Simplify a line or polygon using an epsilon-circle based selection.

References

Examples

>>> line = LineString([(0, 0), (10, 0.1), (20, -0.1), (25, 10)])
>>> simplify_reumann_witkam(line, tolerance=0.5)
<LINESTRING (0 0, 20 -0.1, 25 10)>

(Source code)

../_images/simplify_reumann_witkam.png