Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[expressions] Add make_valid and geometries_to_array functions
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
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": "geometries_to_array", | ||
"type": "function", | ||
"groups": ["Arrays"], | ||
"description": "Splits a geometry into simpler geometries in an array.", | ||
"arguments": [{ | ||
"arg": "geometry", | ||
"description": "the input geometry" | ||
}], | ||
"examples": [{ "expression":"geometries_to_array(geom_from_wkt('GeometryCollection (Polygon ((5 8, 4 1, 3 2, 5 8)),LineString (3 2, 4 2))'))", "returns":"[<QgsGeometry: Polygon ((5 8, 4 1, 3 2, 5 8))>, <QgsGeometry: LineString (3 2, 4 2)>]"}, | ||
{ "expression":"geometries_to_array(geom_from_wkt('MULTIPOLYGON(((5 5,0 0,0 10,5 5)),((5 5,10 10,10 0,5 5))'))", "returns":"[<QgsGeometry: Polygon ((5 5, 0 0, 0 10, 5 5))>, <QgsGeometry: Polygon ((5 5, 10 10, 10 0, 5 5))>]"}], | ||
"tags": [ "split", "convert", "separate", "collection", "multi", "part" ] | ||
} |
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,18 @@ | ||
{ | ||
"name": "make_valid", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Returns a valid geometry or an empty geometry if the geometry could not be made valid.", | ||
"arguments": [{ | ||
"arg": "geometry", | ||
"description": "a geometry" | ||
}], | ||
"examples": [{ | ||
"expression": "geom_to_wkt(make_valid(geom_from_wkt('POLYGON((3 2, 4 1, 5 8, 3 2, 4 2))')))", | ||
"returns": "'GeometryCollection (Polygon ((5 8, 4 1, 3 2, 5 8)),LineString (3 2, 4 2))'" | ||
}, { | ||
"expression": "make_valid(geom_from_wkt('LINESTRING(0 0)'))", | ||
"returns": "<empty geometry>" | ||
}], | ||
"tags": ["rules", "valid", "ogc", "according", "formed"] | ||
} |
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