cartagen.simplify_angular#
- simplify_angular(geometry, angle=10.0)#
Simplify a line or polygon by removing vertexes with small angles.
This algorithm, proposed by McMaster [1], eliminates vertices that represent very small turning angles (< 10 degrees). This prevents rounding filters from destroying sharp curvatures, granting the resulting geometry a ‘manually generalised’ characteristic where significant bends remain prominent.
Accept Multi geometries. If a polygon is provided, it also applies the thinning to its holes using the same parameters.
- Parameters:
geometry (
LineString,MultiLineString,Polygon,MultiPolygon,LinearRing) – The geometry to thin. If an open line is provided, the endpoints are preserved. If a closed ring or polygon is provided, the angles wrap around.angle (
float, optional) – Turning-angle threshold in degrees. Vertices creating an exterior angle below this limit will be iteratively removed. Default is 10.0.
- Returns:
LineString,MultiLineString,Polygon,MultiPolygon,LinearRing– Thinned geometry of the same type as input.
See also
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.
simplify_whirlpoolSimplify a line or polygon using an epsilon-circle based selection.
References
Examples
>>> line = LineString([(0, 0), (1, 0.1), (2, 0), (2, 5)]) >>> simplify_angular(line, angle=10.0) <LINESTRING (0 0, 2 0, 2 5)>