Simplify a line or polygon (Visvalingam)
Removes the vertices that make the smallest triangles with their neighbors, down to an area threshold or a target number of vertices, optionally without letting edges cross, and reports the largest deviation.
Kept 4 of 7 vertices. The largest shift is 33.305 m.
| Latitude | Longitude |
|---|---|
| 40.0000000 deg | -105.0000000 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.visvalingam 1.0.0, core 0.1.0
- Model
- Visvalingam-Whyatt on an azimuthal equidistant plane centered on the shape: repeatedly remove the vertex whose triangle with its neighbors has the smallest area (never less than the last removed), until every remaining triangle reaches the threshold or the target count is met. With topology kept, a removal that would make edges cross is skipped. The largest deviation is measured on the ellipsoid
- Accuracy
- Triangle areas are on the plane, exact to about 0.1% for shapes a few hundred kilometers across; the reported deviation is geodesic
- Notes
- None
- Cites
- Visvalingam, M., and Whyatt, J. D., The Cartographic Journal, Line generalisation by repeated elimination of points
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Visvalingam-Whyatt on an azimuthal equidistant plane centered on the shape: repeatedly remove the vertex whose triangle with its neighbors has the smallest area (never less than the last removed), until every remaining triangle reaches the threshold or the target count is met. With topology kept, a removal that would make edges cross is skipped. The largest deviation is measured on the ellipsoid
Show your work
Largest deviation
max over removed vertices of the geodesic distance to their simplified edge3 removed= 33.305 mVertices kept
7 − 3= 4
The same steps an agent gets from the MCP server with explain: true.
Accuracy: Triangle areas are on the plane, exact to about 0.1% for shapes a few hundred kilometers across; the reported deviation is geodesic
When to use this: Use this to thin a line when you care how it looks rather than how far it moves. Visvalingam-Whyatt drops the vertices that contribute least area, so it takes out the small wiggles first and keeps the shape's character — which is why cartographers reach for it when a coastline or a contour has to be drawn smaller. Ask for an area threshold, or ask for a number of vertices and get the best line of that length, which Douglas-Peucker cannot do because its threshold is a distance and the count that falls out of it is not controllable.
Limitations: The threshold is an area and the guarantee is about area, so unlike Douglas-Peucker this makes no promise about how far the line moves; the largest deviation is reported precisely because it is not bounded in advance. Removing vertices by least area is a good rule for appearance and a poor one for tolerance — a long thin triangle has little area but its apex can be far from the line that replaces it. Vertices are dropped, never moved, so the result is always a subset of the input. Without the topology option a simplified outline can cross itself; with it, vertices are put back and the count says how many.
Worked example: The wavy track down to 4 vertices. Source: Visvalingam and Whyatt (1993) with geodesic deviations (Karney 2013). Checked against urschrei's simplification crate, an unrelated implementation of the same paper, over six shapes at four area thresholds each: the two kept exactly the same vertices in all twenty-four.
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
- Target vertex count
- 4
You get
- Vertices kept
- 4
- Vertices given
- 7
- Largest deviation
- 33.305 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
- Line generalisation by repeated elimination of points, Visvalingam, M., and Whyatt, J. D., The Cartographic Journal, Vol. 30, No. 1. pp. 46-51 (effective area).