Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature][expressions] Add new densify_by_count and densify_by_distance
expression functions These functions expose the existing Processing densify functionality for use in expression functions Fixes #24853
- Loading branch information
1 parent
a27a4ea
commit 3d8fc9d
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "densify_by_count", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Takes a polygon or line layer geometry and generates a new one in which the geometries have a larger number of vertices than the original one.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry (accepts (multi)linestrings or (multi)polygons)."}, | ||
{"arg":"vertices","description":"number of vertices to add (per segment)"} | ||
], | ||
"examples": [ | ||
{ "expression":"geom_to_wkt(densify_by_count(geom_from_wkt('LINESTRING(1 1, 10 1)'), 3))", "returns":"LineString (1 1, 3.25 1, 5.5 1, 7.75 1, 10 1)"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "densify_by_distance", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Takes a polygon or line layer geometry and generates a new one in which the geometries are densified by adding additional vertices on edges that have a maximum distance of the specified interval distance.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry (accepts (multi)linestrings or (multi)polygons)."}, | ||
{"arg":"distance","description":"maximum interval distance between vertices in output geometry"} | ||
], | ||
"examples": [ | ||
{ "expression":"geom_to_wkt(densify_by_distance(geom_from_wkt('LINESTRING(1 1, 10 1)'), 4))", "returns":"LineString (1 1, 4 1, 7 1, 10 1)"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters