Add precision and examples to x, y and z expression functions

This commit is contained in:
Harrissou Sant-anna 2020-07-12 01:07:32 +02:00 committed by Nyall Dawson
parent d4e60173bc
commit 5901d5dc6f
7 changed files with 15 additions and 9 deletions

View File

@ -2,7 +2,7 @@
"name": "$x",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the x coordinate of the current feature.",
"description": "Returns the x coordinate of the current point feature.",
"examples": [ { "expression":"$x", "returns":"42"}
]
}

View File

@ -2,7 +2,7 @@
"name": "$y",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the y coordinate of the current feature.",
"description": "Returns the y coordinate of the current point feature.",
"examples": [ { "expression":"$y", "returns":"42"}
]
}

View File

@ -2,7 +2,7 @@
"name": "x",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the x coordinate of a point geometry, or the x-coordinate of the centroid for a non-point geometry.",
"description": "Returns the x coordinate of a point geometry, or the x coordinate of the centroid for a non-point geometry.",
"arguments": [ {"arg":"geom","description":"a geometry"}],
"examples": [ { "expression":"x( geom_from_wkt( 'POINT(2 5)' ) )", "returns":"2"},
{ "expression":"x( $geometry )", "returns":"x coordinate of the current feature's centroid"}

View File

@ -2,7 +2,7 @@
"name": "y",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the y coordinate of a point geometry, or the y-coordinate of the centroid for a non-point geometry.",
"description": "Returns the y coordinate of a point geometry, or the y coordinate of the centroid for a non-point geometry.",
"arguments": [ {"arg":"geom","description":"a geometry"}],
"examples": [ { "expression":"y( geom_from_wkt( 'POINT(2 5)' ) )", "returns":"5"},
{ "expression":"y( $geometry )", "returns":"y coordinate of the current feature's centroid"}

View File

@ -2,7 +2,7 @@
"name": "z",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the z coordinate of a point geometry.",
"description": "Returns the z coordinate of a point geometry, or Null if the geometry has no z value.",
"arguments": [ {"arg":"geom","description":"a point geometry"}],
"examples": [ { "expression":"z( geom_from_wkt( 'POINTZ(2 5 7)' ) )", "returns":"7"}
]

View File

@ -2,9 +2,12 @@
"name": "z_max",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the maximum z coordinate of a geometry.",
"description": "Returns the maximum z coordinate of a geometry, or Null if the geometry has no z value.",
"arguments": [ {"arg":"geometry","description":"a geometry with z coordinate"}],
"examples": [ { "expression":"z_max( geom_from_wkt( 'POINT ( 0 0 1 )' ) )", "returns":"1"},
{ "expression":"z_max( make_line( make_point( 0,0,0 ), make_point( -1,-1,-2 ) ) )", "returns":"0"}
{ "expression":"z_max( geom_from_wkt( 'MULTIPOINT ( 0 0 1 , 1 1 3 )' ) )", "returns":"3"},
{ "expression":"z_max( make_line( make_point( 0,0,0 ), make_point( -1,-1,-2 ) ) )", "returns":"0"},
{ "expression":"z_max( geom_from_wkt( 'LINESTRING( 0 0 0, 1 0 2, 1 1 -1 )' ) ), "returns":"2"},
{ "expression":"z_max( geom_from_wkt( 'POINT ( 0 0 )' ) )", "returns":"Null"}
]
}

View File

@ -2,9 +2,12 @@
"name": "z_min",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns the minimum z coordinate of a geometry.",
"description": "Returns the minimum z coordinate of a geometry, or Null if the geometry has no z value.",
"arguments": [ {"arg":"geometry","description":"a geometry with z coordinate"}],
"examples": [ { "expression":"z_min( geom_from_wkt( 'POINT ( 0 0 1 )' ) )", "returns":"1"},
{ "expression":"z_min( make_line( make_point( 0,0,0 ), make_point( -1,-1,-2 ) ) )", "returns":"-2"}
{ "expression":"z_min( geom_from_wkt( 'MULTIPOINT ( 0 0 1 , 1 1 3 )' ) )", "returns":"1"},
{ "expression":"z_min( make_line( make_point( 0,0,0 ), make_point( -1,-1,-2 ) ) )", "returns":"-2"},
{ "expression":"z_min( geom_from_wkt( 'LINESTRING( 0 0 0, 1 0 2, 1 1 -1 )' ) ), "returns":"-1"},
{ "expression":"z_min( geom_from_wkt( 'POINT ( 0 0 )' ) )", "returns":"Null"}
]
}