Nyall Dawson 679797e22b [FEATURE] New simplify + smoothing expression functions
Exposes simplification and smoothing algorithms to expression
engine, via:

- simplify(): applies Douglas-Peucker geometry simplification
- simplify_vw(): applies Visvalingam-Whyatt geometry simplification
- smooth(): smoothes a geometry

Carto tip: use smooth along with geometry generators to minimise
the typical "GIS" noded look of rendered geometries!
2016-09-03 21:52:06 +10:00

10 lines
647 B
Plaintext

{
"name": "simplify",
"type": "function",
"description":"Simplifies a geometry by removing nodes using a distance based threshold (ie, the Douglas Peucker algorithm). The algorithm preserves large deviations in geometries and reduces the number of vertices in nearly straight segments.",
"arguments": [ {"arg":"geometry","description":"a geometry"},
{"arg":"tolerance","description":"maximum deviation from straight segments for points to be removed"} ],
"examples": [ { "expression":"geom_to_wkt(simplify(geometry:=geom_from_wkt('LineString(0 0, 5 0.1, 10 0)'),tolerance:=5))", "returns":"'LineString(0 0, 10 0)'"}]
}