pygeoops.simplify#

pygeoops.simplify(geometry, tolerance: float, algorithm: str = 'rdp', lookahead: int = 8, preserve_topology: bool = True, preserve_common_boundaries=False, keep_points_on: Optional[BaseGeometry] = None) Optional[Union[BaseGeometry, ndarray[Any, dtype[BaseGeometry]], GeoSeries]]#

Simplify the geometry/geometries.

Parameters:
  • geometry (geometry or array_like) – a geometry or ndarray of geometries.

  • tolerance (float) – mandatory for the following algorithms: * “rdp”: distance to use as tolerance * “lang”: distance to use as tolerance * “vw”: area to use as tolerance

  • algorithm (str, optional) –

    algorithm to use. Defaults to “rdp”. * “rdp”: Ramer Douglas Peuker algorithm * “lang”: Lang algorithm * “lang+”: Lang-based algorithm, but without limit of having at least

    nb_input_coordinates/lookahead points in the simplified output.

    • ”vw”: Visvalingal Whyatt algorithm

  • lookahead (int, optional) – the number of points to consider for removing in a moving window. Used for LANG algorithm. Defaults to 8.

  • preserve_topology (bool, optional) – True to (try to) return valid geometries as result. Defaults to True.

  • preserve_common_boundaries (bool, optional) – True to (try to) maintain common boundaries between all geometries in the input geometry list. Defaults to False.

  • keep_points_on (BaseGeometry], optional) – point of the geometry to that intersect with these geometries are not removed. Defaults to None.

Raises:

Exception – [description]

Returns:

the

simplified version of the input geometry/geometries.

Return type:

Union[BaseGeometry, NDArray[BaseGeometry], GeoSeries, None]