mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
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!
10 lines
647 B
Plaintext
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)'"}]
|
|
}
|
|
|