Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/function_help/json/$x
Expand Up @@ -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. If the feature is a multipoint feature, then the x-coordinate of the first point will be returned.",
"examples": [ { "expression":"$x", "returns":"42"}
]
}
2 changes: 1 addition & 1 deletion resources/function_help/json/$y
Expand Up @@ -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. If the feature is a multipoint feature, then the y-coordinate of the first point will be returned.",
"examples": [ { "expression":"$y", "returns":"42"}
]
}
2 changes: 1 addition & 1 deletion resources/function_help/json/x
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/y
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/z
Expand Up @@ -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"}
]
Expand Down
7 changes: 5 additions & 2 deletions resources/function_help/json/z_max
Expand Up @@ -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.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR specifically, but we probably should do a scan and unify how "null" is represented in these help files. There's a mix of "NULL"/"Null"/"null"

"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"}
]
}
7 changes: 5 additions & 2 deletions resources/function_help/json/z_min
Expand Up @@ -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"}
]
}