Skip to content
Permalink
Browse files

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

  • Loading branch information
DelazJ authored and nyalldawson committed Jul 21, 2020
1 parent d4e6017 commit 5901d5dc6fedc3effa539f0a646b10bcbd74093c
@@ -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"}
]
}
@@ -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"}
]
}
@@ -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"}
@@ -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"}
@@ -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"}
]
@@ -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"}
]
}
@@ -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"}
]
}

0 comments on commit 5901d5d

Please sign in to comment.
You can’t perform that action at this time.