The standard parameters of Douglas-Peucker's simplify algorithm are geometry and tolerance (e.g ST_Simplify in PostGIS). What's the meaning of the tolerance parameter? I know that the bigger the value, the coarser the geometry will be. But does the number has any unit or it is just arbitrary?
3 Answers
The tolerance is a distance. Roughly, any "wiggles" in a curve that vary from a straight line by less than this amount will be straightened out. The algorithm finds the most extreme wiggles that exceed the tolerance, pins down the points where they deviate the most from a straight path, and then recursively applies itself to the arcs between the pinned-down wiggles.
The tolerance must be expressed in the same units used by the software to execute the algorithm. (This will depend on whether it uses the coordinates as stored or as projected "on the fly" for display or analysis.) An illustrated description appears in the Wikipedia article on the Douglas-Peucker algorithm.
- 69,783
- 15
- 186
- 281
Didn't see it in the link you posted but found this:
The units of tolerance are the same as the projection of the input geometry.
http://revenant.ca/www/postgis/workshop/advanced.html#processing-functions
- 14,462
- 2
- 44
- 63
-
1I see. But what does it exactly means when say the geometry is WGS84 (lat/lon) and set the tolerance to 1.0? Error within 1 degree? Still a bit confused. – ejel Jul 06 '11 at 22:59
-
1I wouldn't say "error within 1 degree" ... take a look at the wikipedia page for the algorithm, there's a nice graphic and good explanation there: http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm – Derek Swingley Jul 06 '11 at 23:26
-
How to check sensibility? Testing
ST_Simplify(geom,0.00001)=geomis false.. But evenST_AsGeoJSON(geom,3)=ST_AsGeoJSON(ST_Simplify(geom,0.0000001),3)is false!! – Peter Krauss Feb 11 '20 at 13:22
All points in the simplified object will be within the tolerance distance of the original geometry.
- 33
- 4
ST_Simplify(geom,0.00001)=geomis false.. But evenST_AsGeoJSON(geom,3)=ST_AsGeoJSON(ST_Simplify(geom,0.0000001),3)is false!! – Peter Krauss Feb 11 '20 at 13:24