# geopandas.GeoSeries.simplify#

GeoSeries.simplify(tolerance, preserve_topology=True)[source]#

Returns a GeoSeries containing a simplified representation of each geometry.

The algorithm (Douglas-Peucker) recursively splits the original line into smaller parts and connects these parts’ endpoints by a straight line. Then, it removes all points whose distance to the straight line is smaller than tolerance. It does not move any points and it always preserves endpoints of the original line or polygon. See http://shapely.readthedocs.io/en/latest/manual.html#object.simplify for details

Parameters:
tolerancefloat

All parts of a simplified geometry will be no more than tolerance distance from the original. It has the same units as the coordinate reference system of the GeoSeries. For example, using tolerance=100 in a projected CRS with meters as units means a distance of 100 meters in reality.

preserve_topology: bool (default True)

False uses a quicker algorithm, but may produce self-intersecting or otherwise invalid geometries.

Notes

Invalid geometric objects may result from simplification that does not preserve topology and simplification may be sensitive to the order of coordinates: two geometries differing only in order of coordinates may be simplified differently.

Examples

>>> from shapely.geometry import Point, LineString
>>> s = geopandas.GeoSeries(
...     [Point(0, 0).buffer(1), LineString([(0, 0), (1, 10), (0, 20)])]
... )
>>> s
0    POLYGON ((1 0, 0.99518 -0.09802, 0.98079 -0.19...
1                         LINESTRING (0 0, 1 10, 0 20)
dtype: geometry
>>> s.simplify(1)
0    POLYGON ((0 1, 0 -1, -1 0, 0 1))
1              LINESTRING (0 0, 0 20)
dtype: geometry