cartagen.simplify_whirlpool#
- simplify_whirlpool(geometry, threshold)#
Simplify a line or polygon using an epsilon-circle based selection.
This algorithm proposed by Dougenik and Chrisman [1] performs a line simplification that removes spiky vertices while preserving the overall shape of the line. It works by iterating through the vertices of the line and removing those that are within a specified distance (epsilon) from the last kept vertex.
This method is particularly effective at simplifying lines with many small, sharp angles, such as rivers or coastlines, while maintaining the general form of the line.
- Parameters:
geometry (
LineString,MultiLineString,Polygon,MultiPolygon,LinearRing) – The geometry to simplify.threshold (
float) – The minimum epsilon-distance to consider a vertex to be removed. Higher values = fewer points kept (more aggressive simplification).
- Returns:
LineString,MultiLineString,Polygon,MultiPolygon,LinearRing
See also
simplify_angularSimplify a line or polygon by removing vertexes with small angles.
simplify_douglas_peuckerSimplify a line or polygon using a distance-based selection.
simplify_langSimplify a line or polygon using a look-ahead distance-based selection.
simplify_li_openshawSimplify a line or a polygon using a regular grid.
simplify_raposoSimplify a line or a polygon using an hexagonal tessellation.
simplify_reumann_witkamSimplify a line or polygon using a directional distance-based selection.
simplify_visvalingam_whyattSimplify a line or polygon using an area-based selection.
simplify_wang_mullerSimplify a line or polygon using a bend-reduction method.
References
Examples
>>> line = LineString([(0, 0), (1, 1), (2, 0), (5, 3)]) >>> simplify_whirlpool(line, threshold=2.0) <LINESTRING (0 0, 5 3)>