Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add missing optional flag in some qgs expression helps
  • Loading branch information
Gustry authored and nyalldawson committed Oct 25, 2018
1 parent 236edd2 commit d6a2cbf
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 38 deletions.
12 changes: 7 additions & 5 deletions resources/function_help/json/make_circle
Expand Up @@ -4,11 +4,13 @@
"description": "Creates a circular polygon.",
"variableLenArguments": true,
"arguments": [
{"arg":"center", "description": "center point of the circle"},
{"arg":"radius", "description": "radius of the circle"},
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [ { "expression":"geom_to_wkt(make_circle(make_point(10,10), 5, 4))", "returns":"'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'"},
{"arg":"center", "description": "center point of the circle"},
{"arg":"radius", "description": "radius of the circle"},
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}
],
"examples": [
{ "expression":"geom_to_wkt(make_circle(make_point(10,10), 5, 4))", "returns":"'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'"},
{ "expression":"geom_to_wkt(make_circle(make_point(10,10,5), 5, 4))", "returns":"'PolygonZ ((10 15 5, 15 10 5, 10 5 5, 5 10 5, 10 15 5))'"},
{ "expression":"geom_to_wkt(make_circle(make_point(10,10,5,30), 5, 4))", "returns":"'PolygonZM ((10 15 5 30, 15 10 5 30, 10 5 5 30, 5 10 5 30, 10 15 5 30))'"}
]
]
}
16 changes: 9 additions & 7 deletions resources/function_help/json/make_ellipse
Expand Up @@ -4,13 +4,15 @@
"description": "Creates an elliptical polygon.",
"variableLenArguments": true,
"arguments": [
{"arg":"center", "description": "center point of the ellipse"},
{"arg":"semi_major_axis", "description": "semi-major axis of the ellipse"},
{"arg":"semi_minor_axis", "description": "semi-minor axis of the ellipse"},
{"arg":"azimuth", "description": "orientation of the ellipse"},
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [ { "expression":"geom_to_wkt(make_ellipse(make_point(10,10), 5, 2, 90, 4))", "returns":"'Polygon ((15 10, 10 8, 5 10, 10 12, 15 10))'"},
{"arg":"center", "description": "center point of the ellipse"},
{"arg":"semi_major_axis", "description": "semi-major axis of the ellipse"},
{"arg":"semi_minor_axis", "description": "semi-minor axis of the ellipse"},
{"arg":"azimuth", "description": "orientation of the ellipse"},
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}
],
"examples": [
{ "expression":"geom_to_wkt(make_ellipse(make_point(10,10), 5, 2, 90, 4))", "returns":"'Polygon ((15 10, 10 8, 5 10, 10 12, 15 10))'"},
{ "expression":"geom_to_wkt(make_ellipse(make_point(10,10,5), 5, 2, 90, 4))", "returns":"'PolygonZ ((15 10 5, 10 8 5, 5 10 5, 10 12 5, 15 10 5))'"},
{ "expression":"geom_to_wkt(make_ellipse(make_point(10,10,5,30), 5, 2, 90, 4))", "returns":"'PolygonZM ((15 10 5 30, 10 8 5 30, 5 10 5 30, 10 12 5 30, 15 10 5 30))'"}
]
]
}
14 changes: 8 additions & 6 deletions resources/function_help/json/make_point
Expand Up @@ -3,12 +3,14 @@
"type": "function",
"description": "Creates a point geometry from an x and y (and optional z and m) value.",
"arguments": [
{"arg":"x","description":"x coordinate of point"},
{"arg":"y","description":"y coordinate of point"},
{"arg":"z","description":"optional z coordinate of point"},
{"arg":"m","description":"optional m value of point"} ],
"examples": [ { "expression":"geom_to_wkt(make_point(2,4))", "returns":"'Point (2 4)'"},
{"arg":"x","description":"x coordinate of point"},
{"arg":"y","description":"y coordinate of point"},
{"arg":"z", "optional": true, "description":"optional z coordinate of point"},
{"arg":"m", "optional": true, "description":"optional m value of point"}
],
"examples": [
{ "expression":"geom_to_wkt(make_point(2,4))", "returns":"'Point (2 4)'"},
{ "expression":"geom_to_wkt(make_point(2,4,6))", "returns":"'PointZ (2 4 6)'"},
{ "expression":"geom_to_wkt(make_point(2,4,6,8))", "returns":"'PointZM (2 4 6 8)'"}
]
]
}
14 changes: 8 additions & 6 deletions resources/function_help/json/make_regular_polygon
Expand Up @@ -4,11 +4,13 @@
"description": "Creates a regular polygon.",
"variableLenArguments": true,
"arguments": [
{"arg":"center", "description": "center of the regular polygon"},
{"arg":"radius", "description": "second point. The first if the regular polygon is inscribed. The midpoint of the first side if the regular polygon is circumscribed."},
{"arg":"number_sides", "description": "Number of sides/edges of the regular polygon"},
{"arg":"circle", "description": "Optional argument to construct the regular polygon. By default this value is 0. Value can be 0 (inscribed) or 1 (circumscribed)"}],
"examples": [ { "expression":"geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5))", "returns":"'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'"},
{"arg":"center", "description": "center of the regular polygon"},
{"arg":"radius", "description": "second point. The first if the regular polygon is inscribed. The midpoint of the first side if the regular polygon is circumscribed."},
{"arg":"number_sides", "description": "Number of sides/edges of the regular polygon"},
{"arg":"circle", "optional": true, "default": "0", "description": "Optional argument to construct the regular polygon. By default this value is 0. Value can be 0 (inscribed) or 1 (circumscribed)"}
],
"examples": [
{ "expression":"geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5))", "returns":"'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'"},
{ "expression":"geom_to_wkt(make_regular_polygon(make_point(0,0), project(make_point(0,0), 4.0451, radians(36)), 5))", "returns":"'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'"}
]
]
}
10 changes: 6 additions & 4 deletions resources/function_help/json/minimal_circle
Expand Up @@ -2,9 +2,11 @@
"name": "minimal_circle",
"type": "function",
"description": "Returns the minimal enclosing circle of a geometry. It represents the minimum circle that encloses all geometries within the set.",
"arguments": [ {"arg":"geometry","description":"a geometry"},
{"arg":"segment", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [ { "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )", "returns":"Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))"},
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )", "returns":"Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))"}
"arguments": [
{"arg":"geometry","description":"a geometry"},
{"arg":"segment", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )", "returns":"Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))"},
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )", "returns":"Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))"}
]
}
12 changes: 8 additions & 4 deletions resources/function_help/json/nodes_to_points
Expand Up @@ -2,8 +2,12 @@
"name": "nodes_to_points",
"type": "function",
"description": "Returns a multipoint geometry consisting of every node in the input geometry.",
"arguments": [ {"arg":"geometry","description":"geometry object"},
{"arg":"ignore_closing_nodes","description":"optional argument specifying whether to include duplicate nodes which close lines or polygons rings. Defaults to false, set to true to avoid including these duplicate nodes in the output collection."} ],
"examples": [ { "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))", "returns":"'MultiPoint ((0 0),(1 1),(2 2))'"},
{ "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))", "returns":"'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'"}]
"arguments": [
{"arg":"geometry","description":"geometry object"},
{"arg":"ignore_closing_nodes", "optional": true, "default": "false", "description":"optional argument specifying whether to include duplicate nodes which close lines or polygons rings. Defaults to false, set to true to avoid including these duplicate nodes in the output collection."}
],
"examples": [
{ "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))", "returns":"'MultiPoint ((0 0),(1 1),(2 2))'"},
{ "expression":"geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))", "returns":"'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'"}
]
}
15 changes: 9 additions & 6 deletions resources/function_help/json/wordwrap
Expand Up @@ -2,10 +2,13 @@
"name": "wordwrap",
"type": "function",
"description": "Returns a string wrapped to a maximum/minimum number of characters.",
"arguments": [ {"arg":"string","description":"the string to be wrapped"},
{"arg":"wrap_length","description":"an integer. If wrap_length is positive the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap."},
{"arg":"delimiter_string","description":"the delimiter string to wrap to a new line (optional)."}
],
"examples": [ { "expression":"wordwrap('UNIVERSITY OF QGIS',13)", "returns":"'UNIVERSITY OF<br>QGIS'"},
{ "expression":"wordwrap('UNIVERSITY OF QGIS',-3)", "returns":"'UNIVERSITY<br>OF QGIS'"} ]
"arguments": [
{"arg":"string","description":"the string to be wrapped"},
{"arg":"wrap_length","description":"an integer. If wrap_length is positive the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap."},
{"arg":"delimiter_string","optional": true, "description":"Optional delimiter string to wrap to a new line."}
],
"examples": [
{ "expression":"wordwrap('UNIVERSITY OF QGIS',13)", "returns":"'UNIVERSITY OF<br>QGIS'"},
{ "expression":"wordwrap('UNIVERSITY OF QGIS',-3)", "returns":"'UNIVERSITY<br>OF QGIS'"}
]
}

0 comments on commit d6a2cbf

Please sign in to comment.