Simplify a line or polygon (Douglas-Peucker)
Removes vertices from a line or polygon while keeping every removed vertex within a distance tolerance of the simplified geodesic edges, optionally without letting edges cross, and reports the largest deviation.
Kept 7 of 7 vertices. The largest shift is 0 m.
| Latitude | Longitude |
|---|---|
| 40.0000000 deg | -105.0000000 deg |
| 40.0002000 deg | -104.9980000 deg |
| 39.9998000 deg | -104.9960000 deg |
| 40.0003000 deg | -104.9940000 deg |
| 40.0000000 deg | -104.9920000 deg |
| 40.0015000 deg | -104.9900000 deg |
| 40.0000000 deg | -104.9880000 deg |
- Vertices given
- Largest deviation
- Vertices put back
Provenance
- Computed by
- geometry.simplify.rdp 1.0.0, core 0.1.0
- Model
- Ramer-Douglas-Peucker on an azimuthal equidistant plane centered on the shape, then checked on the ellipsoid: any edge with a removed vertex farther than the tolerance (by geodesic distance) is split again. A polygon is split at the vertex farthest from its first. With topology kept, crossing edges get their farthest vertex back until none cross
- Accuracy
- Every removed vertex is within the tolerance of its simplified geodesic edge, measured on the ellipsoid; the crossing check is on the plane, exact for shapes a few hundred kilometers across
- Notes
- None
- Cites
- Douglas, D. H., and Peucker, T. K., Cartographica, Algorithms for the reduction of the number of points required to represent a digitized line or its caricature
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Ramer-Douglas-Peucker on an azimuthal equidistant plane centered on the shape, then checked on the ellipsoid: any edge with a removed vertex farther than the tolerance (by geodesic distance) is split again. A polygon is split at the vertex farthest from its first. With topology kept, crossing edges get their farthest vertex back until none cross
Show your work
Largest deviation
max over removed vertices of the geodesic distance to their simplified edge0 removed= 0 mVertices kept
7 − 0= 7
The same steps an agent gets from the MCP server with explain: true.
Accuracy: Every removed vertex is within the tolerance of its simplified geodesic edge, measured on the ellipsoid; the crossing check is on the plane, exact for shapes a few hundred kilometers across
When to use this: Use this to thin a track or an outline that carries more detail than the job needs: a GPS trace logged every second, a coastline captured finer than the map will ever show, a boundary being sent over a slow link or drawn in a browser. Set the tolerance to the error you are willing to accept on the ground and every dropped vertex is guaranteed to lie within it. Keeping topology costs a few vertices and stops a simplified outline crossing itself, which matters when the result has to stay a valid area.
Limitations: The guarantee is about distance from the simplified line, not about anything else you might care about: area, length and the position of the centroid all change, and a polygon simplified hard can lose a noticeable fraction of its area. The tolerance is a bound, not a target — a shape already straighter than the tolerance collapses to its two end points however large it was. Without the topology option a simplified outline can cross itself, which is why that option exists; with it, a few vertices are put back and the count reported says how many. Vertices are dropped, never moved, so the result is always a subset of the input and never smooths a corner.
Worked example: A wavy 1 km track at a 25 m tolerance. Source: Douglas and Peucker (1973) with geodesic deviations (Karney 2013). Checked against GEOS 3.11.4's own LineString.simplify on the same plane over six shapes at four tolerances each: the two implementations kept the same vertices in all twenty-four, with the deviations agreeing to 1.3e-7 relative.
You enter
- Vertices
- 40, -105 40.0002, -104.998 39.9998, -104.996 40.0003, -104.994 40, -104.992 40.0015, -104.99 40, -104.988
- Tolerance
- 25 m
You get
- Vertices kept
- 7
- Vertices given
- 7
- Largest deviation
- 0 m
- Vertices put back
- 0
Review: Not yet independently reviewed by a GIS professional.
Last verified: 2026-09-22, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Checked against: 29 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- Algorithms for the reduction of the number of points required to represent a digitized line or its caricature, Douglas, D. H., and Peucker, T. K., Cartographica, Vol. 10, No. 2. pp. 112-122.