Skip to content

Commit

Permalink
Update more geometry overlay functions help
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Oct 29, 2020
1 parent df0950c commit 5ccad91
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 73 deletions.
2 changes: 1 addition & 1 deletion resources/function_help/json/overlay_contains
Expand Up @@ -2,7 +2,7 @@
"name": "overlay_contains",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns whether the current feature spatially contains at least one feature from a target layer, or an array of expression-based results for the features in the target layer contained in the current feature.<br><br>Read more on the underlying GEOS \"Contains\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Contains.html'>ST_CONTAINS</a> function.",
"description": "Returns whether the current feature spatially contains at least one feature from a target layer, or an array of expression-based results for the features in the target layer contained in the current feature.<br><br>Read more on the underlying GEOS \"Contains\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Contains.html'>ST_Contains</a> function.",
"arguments": [
{
"arg": "layer",
Expand Down
28 changes: 16 additions & 12 deletions resources/function_help/json/overlay_crosses
Expand Up @@ -2,50 +2,54 @@
"name": "overlay_crosses",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type CROSSES. This returns an array of results of an expression evaluated on features from a different layer that CROSSES the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer CROSSES the current feature.",
"description": "Returns whether the current feature spatially crosses at least one feature from a target layer, or an array of expression-based results for the features in the target layer crossed by the current feature.<br><br>Read more on the underlying GEOS \"Crosses\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Crosses.html'>ST_Crosses</a> function.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
"description": "the layer whose overlay is checked"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"description": "an optional expression to evaluate on the features from the target layer. If not set, the function will just return a boolean indicating whether there is at least one match.",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"description": "an optional expression to filter the target features to check. If not set, all the features will be checked.",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"description": "an optional integer to limit the number of matching features. If not set, all the matching features will be returned.",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
"default": "false"
}
],
"examples": [
{
"expression": "overlay_crosses('regions')",
"returns": "True"
"returns": "true if the current feature spatially crosses a region"
},
{
"expression": "overlay_crosses('regions', filter:= population > 10000)",
"returns": "true if the current feature spatially crosses a region with a population greater than 10000"
},
{
"expression": "overlay_crosses('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
"returns": "an array of names, for the regions crossed by the current feature"
},
{
"expression": "overlay_crosses('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
"expression": "array_sort(overlay_crosses(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions crossed by the current feature and with a population greater than 10000"
},
{
"expression": "overlay_crosses('regions', name, limit:=1)",
"returns": "['South Africa']"
"expression": "overlay_crosses(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions crossed by the current feature"
}
]
}
28 changes: 16 additions & 12 deletions resources/function_help/json/overlay_disjoint
Expand Up @@ -2,50 +2,54 @@
"name": "overlay_disjoint",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type DISJOINT. This returns an array of results of an expression evaluated on features from a different layer that DISJOINT the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer DISJOINT the current feature.",
"description": "Returns whether the current feature is spatially disjoint from at least one feature from a target layer, or an array of expression-based results for the features in the target layer that are disjoint from the current feature.<br><br>Read more on the underlying GEOS \"Disjoint\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Disjoint.html'>ST_Disjoint</a> function.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
"description": "the layer whose overlay is checked"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"description": "an optional expression to evaluate on the features from the target layer. If not set, the function will just return a boolean indicating whether there is at least one match.",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"description": "an optional expression to filter the target features to check. If not set, all the features will be checked.",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"description": "an optional integer to limit the number of matching features. If not set, all the matching features will be returned.",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
"default": "false"
}
],
"examples": [
{
"expression": "overlay_disjoint('regions')",
"returns": "True"
"returns": "true if the current feature is spatially disjoint from a region"
},
{
"expression": "overlay_disjoint('regions', filter:= population > 10000)",
"returns": "true if the current feature is spatially disjoint from a region with a population greater than 10000"
},
{
"expression": "overlay_disjoint('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
"returns": "an array of names, for the regions spatially disjoint from the current feature"
},
{
"expression": "overlay_disjoint('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
"expression": "array_sort(overlay_disjoint(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions spatially disjoint from the current feature and with a population greater than 10000"
},
{
"expression": "overlay_disjoint('regions', name, limit:=1)",
"returns": "['South Africa']"
"expression": "overlay_disjoint(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions spatially disjoint from the current feature"
}
]
}
28 changes: 16 additions & 12 deletions resources/function_help/json/overlay_equals
Expand Up @@ -2,50 +2,54 @@
"name": "overlay_equals",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type EQUALS. This returns an array of results of an expression evaluated on features from a different layer that EQUALS the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer EQUALS the current feature.",
"description": "Returns whether the current feature spatially equals to at least one feature from a target layer, or an array of expression-based results for the features in the target layer that are spatially equal to the current feature.<br><br>Read more on the underlying GEOS \"Equals\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Equals.html'>ST_Equals</a> function.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
"description": "the layer whose overlay is checked"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"description": "an optional expression to evaluate on the features from the target layer. If not set, the function will just return a boolean indicating whether there is at least one match.",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"description": "an optional expression to filter the target features to check. If not set, all the features will be checked.",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"description": "an optional integer to limit the number of matching features. If not set, all the matching features will be returned.",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
"default": "false"
}
],
"examples": [
{
"expression": "overlay_equals('regions')",
"returns": "True"
"returns": "true if the current feature is spatially equal to a region"
},
{
"expression": "overlay_equals('regions', filter:= population > 10000)",
"returns": "true if the current feature is spatially equal to a region with a population greater than 10000"
},
{
"expression": "overlay_equals('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
"returns": "an array of names, for the regions spatially equal to the current feature"
},
{
"expression": "overlay_equals('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
"expression": "array_sort(overlay_equals(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions spatially equal to the current feature and with a population greater than 10000"
},
{
"expression": "overlay_equals('regions', name, limit:=1)",
"returns": "['South Africa']"
"expression": "overlay_equals(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions spatially equal to the current feature"
}
]
}
28 changes: 16 additions & 12 deletions resources/function_help/json/overlay_intersects
Expand Up @@ -2,50 +2,54 @@
"name": "overlay_intersects",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type INTERSECTS. This returns an array of results of an expression evaluated on features from a different layer that INTERSECTS the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer INTERSECTS the current feature.",
"description": "Returns whether the current feature spatially intersects at least one feature from a target layer, or an array of expression-based results for the features in the target layer intersected by the current feature.<br><br>Read more on the underlying GEOS \"Intersects\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Intersects.html'>ST_INTERSECTS</a> function.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
"description": "the layer whose overlay is checked"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"description": "an optional expression to evaluate on the features from the target layer. If not set, the function will just return a boolean indicating whether there is at least one match.",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"description": "an optional expression to filter the target features to check. If not set, all the features will be checked.",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"description": "an optional integer to limit the number of matching features. If not set, all the matching features will be returned.",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
"default": "false"
}
],
"examples": [
{
"expression": "overlay_intersects('regions')",
"returns": "True"
"returns": "true if the current feature spatially intersects a region"
},
{
"expression": "overlay_intersects('regions', filter:= population > 10000)",
"returns": "true if the current feature spatially intersects a region with a population greater than 10000"
},
{
"expression": "overlay_intersects('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
"returns": "an array of names, for the regions intersected by the current feature"
},
{
"expression": "overlay_intersects('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
"expression": "array_sort(overlay_intersects(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions intersected by the current feature and with a population greater than 10000"
},
{
"expression": "overlay_intersects('regions', name, limit:=1)",
"returns": "['South Africa']"
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions intersected by the current feature"
}
]
}
28 changes: 16 additions & 12 deletions resources/function_help/json/overlay_touches
Expand Up @@ -2,50 +2,54 @@
"name": "overlay_touches",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type TOUCHES. This returns an array of results of an expression evaluated on features from a different layer that TOUCHES the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer TOUCHES the current feature.",
"description": "Returns whether the current feature spatially touches at least one feature from a target layer, or an array of expression-based results for the features in the target layer touched by the current feature.<br><br>Read more on the underlying GEOS \"Touches\" predicate, as described in PostGIS <a href='https://postgis.net/docs/ST_Touches.html'>ST_TOUCHES</a> function.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
"description": "the layer whose overlay is checked"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"description": "an optional expression to evaluate on the features from the target layer. If not set, the function will just return a boolean indicating whether there is at least one match.",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"description": "an optional expression to filter the target features to check. If not set, all the features will be checked.",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"description": "an optional integer to limit the number of matching features. If not set, all the matching features will be returned.",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
"default": "false"
}
],
"examples": [
{
"expression": "overlay_touches('regions')",
"returns": "True"
"returns": "true if the current feature spatially touches a region"
},
{
"expression": "overlay_touches('regions', filter:= population > 10000)",
"returns": "true if the current feature spatially touches a region with a population greater than 10000"
},
{
"expression": "overlay_touches('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
"returns": "an array of names, for the regions touched by the current feature"
},
{
"expression": "overlay_touches('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
"expression": "array_sort(overlay_touches(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions touched by the current feature and with a population greater than 10000"
},
{
"expression": "overlay_touches('regions', name, limit:=1)",
"returns": "['South Africa']"
"expression": "overlay_touches(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions touched by the current feature"
}
]
}

0 comments on commit 5ccad91

Please sign in to comment.