Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33333 from lbartoletti/expression-is_empty
Add expressions is_empty(geom) is_empty_or_null(geom)
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "is_empty", | ||
"type": "function", | ||
"description": "Returns true if a geometry is empty (without coordinates), false if the geometry is not empty and NULL if there is no geometry. See also `is_empty_or_null`.", | ||
"arguments": [ {"arg":"geom","description":"a geometry"}], | ||
"examples": [ { "expression":"is_empty(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))", "returns":"false"}, | ||
{ "expression":"is_empty(geom_from_wkt('LINESTRING EMPTY'))", "returns":"true"}, | ||
{ "expression":"is_empty(geom_from_wkt('POINT(7 4)'))", "returns":"false"}, | ||
{ "expression":"is_empty(geom_from_wkt('POINT EMPTY'))", "returns":"true"} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "is_empty_or_null", | ||
"type": "function", | ||
"description": "Returns true if a geometry is NULL or empty (without coordinates) or false otherwise. This function is like the expression '$geometry IS NULL or is_empty($geometry)'", | ||
"arguments": [ {"arg":"geom","description":"a geometry"}], | ||
"examples": [ { "expression":"is_empty_or_null(NULL)", "returns":"true"}, | ||
{ "expression":"is_empty_or_null(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))", "returns":"false"}, | ||
{ "expression":"is_empty_or_null(geom_from_wkt('LINESTRING EMPTY'))", "returns":"true"}, | ||
{ "expression":"is_empty_or_null(geom_from_wkt('POINT(7 4)'))", "returns":"false"}, | ||
{ "expression":"is_empty_or_null(geom_from_wkt('POINT EMPTY'))", "returns":"true"} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters