-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Add expression for square by diagonal and rectangle from 3 …
…points With the new class QgsQuadrilateral, we can add expressions to create a square by a diagonal and rectangles by 3 points
- Loading branch information
1 parent
200d4f6
commit aaede28
Showing
4 changed files
with
112 additions
and
2 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,17 @@ | ||
{ | ||
"name": "make_rectangle_3points", | ||
"type": "function", | ||
"description": "Creates a rectangle from 3 points.", | ||
"variableLenArguments": true, | ||
"arguments": [ | ||
{"arg":"point1", "description": "First point."}, | ||
{"arg":"point2", "description": "Second point."}, | ||
{"arg":"point3", "description": "Third point."}, | ||
{"arg":"option", "optional": true, "default": "0", "description": | ||
"An optional argument to construct the rectangle. By default this value is 0. Value can be 0 (distance) or 1 (projected). Option distance: Second distance is equal to the distance between 2nd and 3rd point. Option projected: Second distance is equal to the distance of the perpendicular projection of the 3rd point on the segment or its extension."} | ||
], | ||
"examples": [ | ||
{ "expression":"geom_to_wkt(make_rectangle(make_point(0, 0), make_point(0,5), make_point(5, 5), 0)))", "returns":"'Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))'"}, | ||
{ "expression":"geom_to_wkt(make_rectangle(make_point(0, 0), make_point(0,5), make_point(5, 3), 1)))", "returns":"'Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))'"} | ||
] | ||
} |
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,14 @@ | ||
{ | ||
"name": "make_square", | ||
"type": "function", | ||
"description": "Creates a square from a diagonal.", | ||
"variableLenArguments": true, | ||
"arguments": [ | ||
{"arg":"point1", "description": "First point of the regular polygon"}, | ||
{"arg":"point2", "description": "Second point"} | ||
], | ||
"examples": [ | ||
{ "expression":"geom_to_wkt(make_square( make_point(0,0), make_point(5,5)))", "returns":"'Polygon ((0 0, -0 5, 5 5, 5 0, 0 0))'"}, | ||
{ "expression":"geom_to_wkt(make_square( make_point(5,0), make_point(5,5)))", "returns":"'Polygon ((5 0, 2.5 2.5, 5 5, 7.5 2.5, 5 0))'"} | ||
] | ||
} |
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