cartagen.simplify_li_openshaw#
- simplify_li_openshaw(geometry, cell_size, preserve_extremities=True)#
Simplify a line or a polygon using a regular grid.
This algorithm proposed by Li & Openshaw [1] simplifies lines based on a regular square grid. It first divide the line vertexes into groups partionned by a regular grid, then each group of vertexes is replaced by their centroid.
- Parameters:
geometry (
LineString,MultiLineString,Polygon,MultiPolygon,LinearRing) – The geometry to simplify.cell_size (
float) – The size of the regular grid used to divide the line.preserve_extremities (
bool, optional) – Whether the algorithm should preserve the first and last vertex of the input geometry.
- 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_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, 1), (2, 0), (5, 3)]) >>> c4.simplify_li_openshaw(line, 1) <LINESTRING (0 0, 0.5 0.5, 2 0, 5 3)>