mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
22 lines
899 B
Plaintext
22 lines
899 B
Plaintext
{
|
|
"name": "order_parts",
|
|
"type": "function",
|
|
"groups": ["GeometryGroup"],
|
|
"description": "Orders the parts of a MultiGeometry by a given criteria",
|
|
"arguments": [
|
|
{"arg":"geometry","description":"a multi-type geometry"},
|
|
{"arg":"orderby","description":"an expression string defining the order criteria"},
|
|
{"arg":"ascending","optional":true,"default":"true","description":"boolean, True for ascending, False for descending"}
|
|
],
|
|
"examples": [
|
|
{
|
|
"expression":"geom_to_wkt(order_parts(geom_from_wkt('MultiPolygon (((1 1, 5 1, 5 5, 1 5, 1 1)),((1 1, 9 1, 9 9, 1 9, 1 1)))'), 'area($geometry)', False))",
|
|
"returns":"'MultiPolygon (((1 1, 9 1, 9 9, 1 9, 1 1)),((1 1, 5 1, 5 5, 1 5, 1 1)))'"
|
|
},
|
|
{
|
|
"expression":"geom_to_wkt(order_parts(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), '1', True))",
|
|
"returns":"'LineString(1 2, 3 2, 4 3)'"
|
|
}
|
|
]
|
|
}
|