Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #39174 from DelazJ/overlayOnly
Rename geometry_overlay_* functions into overlay_*
  • Loading branch information
m-kuhn committed Oct 9, 2020
2 parents 5ddf9aa + 5f74d6a commit 1258afe
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 101 deletions.
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_contains",
"name": "overlay_contains",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type CONTAINS. This returns an array of results of an expression evaluated on features from a different layer that CONTAINS the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer CONTAINS the current feature.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_contains('regions')",
"expression": "overlay_contains('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_contains('regions', name)",
"expression": "overlay_contains('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_contains('regions', name, name != 'World')",
"expression": "overlay_contains('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_contains('regions', name, limit:=1)",
"expression": "overlay_contains('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_crosses",
"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.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_crosses('regions')",
"expression": "overlay_crosses('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_crosses('regions', name)",
"expression": "overlay_crosses('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_crosses('regions', name, name != 'World')",
"expression": "overlay_crosses('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_crosses('regions', name, limit:=1)",
"expression": "overlay_crosses('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_disjoint",
"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.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_disjoint('regions')",
"expression": "overlay_disjoint('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_disjoint('regions', name)",
"expression": "overlay_disjoint('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_disjoint('regions', name, name != 'World')",
"expression": "overlay_disjoint('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_disjoint('regions', name, limit:=1)",
"expression": "overlay_disjoint('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_equals",
"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.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_equals('regions')",
"expression": "overlay_equals('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_equals('regions', name)",
"expression": "overlay_equals('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_equals('regions', name, name != 'World')",
"expression": "overlay_equals('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_equals('regions', name, limit:=1)",
"expression": "overlay_equals('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_intersects",
"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.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_intersects('regions')",
"expression": "overlay_intersects('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_intersects('regions', name)",
"expression": "overlay_intersects('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_intersects('regions', name, name != 'World')",
"expression": "overlay_intersects('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_intersects('regions', name, limit:=1)",
"expression": "overlay_intersects('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_nearest",
"name": "overlay_nearest",
"type": "function",
"groups": ["GeometryGroup"],
"description": "This returns an array of results of an expression evaluated on features from a different layer ordered BY DISTANCE to the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer was found. Note : this function can be slow and consume a lot of memory for large layers.",
Expand Down Expand Up @@ -37,19 +37,19 @@
],
"examples": [
{
"expression": "geometry_overlay_nearest('regions')",
"expression": "overlay_nearest('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_nearest('regions', name)",
"expression": "overlay_nearest('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_nearest('regions', name, name != 'World')",
"expression": "overlay_nearest('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_nearest('regions', name, limit:=1)",
"expression": "overlay_nearest('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_touches",
"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.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_touches('regions')",
"expression": "overlay_touches('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_touches('regions', name)",
"expression": "overlay_touches('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_touches('regions', name, name != 'World')",
"expression": "overlay_touches('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_touches('regions', name, limit:=1)",
"expression": "overlay_touches('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
@@ -1,5 +1,5 @@
{
"name": "geometry_overlay_within",
"name": "overlay_within",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Performs a spatial join of type WITHIN. This returns an array of results of an expression evaluated on features from a different layer that are WITHIN the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer is WITHIN the current feature.",
Expand Down Expand Up @@ -32,19 +32,19 @@
],
"examples": [
{
"expression": "geometry_overlay_within('regions')",
"expression": "overlay_within('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_within('regions', name)",
"expression": "overlay_within('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_within('regions', name, name != 'World')",
"expression": "overlay_within('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_within('regions', name, limit:=1)",
"expression": "overlay_within('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
Expand Down
16 changes: 8 additions & 8 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -6333,13 +6333,13 @@ const QList<QgsExpressionFunction *> &QgsExpression::Functions()

QMap< QString, QgsExpressionFunction::FcnEval > geometry_overlay_definitions
{
{ QStringLiteral( "geometry_overlay_intersects" ), fcnGeomOverlayIntersects },
{ QStringLiteral( "geometry_overlay_contains" ), fcnGeomOverlayContains },
{ QStringLiteral( "geometry_overlay_crosses" ), fcnGeomOverlayCrosses },
{ QStringLiteral( "geometry_overlay_equals" ), fcnGeomOverlayEquals },
{ QStringLiteral( "geometry_overlay_touches" ), fcnGeomOverlayTouches },
{ QStringLiteral( "geometry_overlay_disjoint" ), fcnGeomOverlayDisjoint },
{ QStringLiteral( "geometry_overlay_within" ), fcnGeomOverlayWithin },
{ QStringLiteral( "overlay_intersects" ), fcnGeomOverlayIntersects },
{ QStringLiteral( "overlay_contains" ), fcnGeomOverlayContains },
{ QStringLiteral( "overlay_crosses" ), fcnGeomOverlayCrosses },
{ QStringLiteral( "overlay_equals" ), fcnGeomOverlayEquals },
{ QStringLiteral( "overlay_touches" ), fcnGeomOverlayTouches },
{ QStringLiteral( "overlay_disjoint" ), fcnGeomOverlayDisjoint },
{ QStringLiteral( "overlay_within" ), fcnGeomOverlayWithin },
};
QMapIterator< QString, QgsExpressionFunction::FcnEval > i( geometry_overlay_definitions );
while ( i.hasNext() )
Expand All @@ -6358,7 +6358,7 @@ const QList<QgsExpressionFunction *> &QgsExpression::Functions()
functions << fcnGeomOverlayFunc;
}

QgsStaticExpressionFunction *fcnGeomOverlayNearestFunc = new QgsStaticExpressionFunction( QStringLiteral( "geometry_overlay_nearest" ), QgsExpressionFunction::ParameterList()
QgsStaticExpressionFunction *fcnGeomOverlayNearestFunc = new QgsStaticExpressionFunction( QStringLiteral( "overlay_nearest" ), QgsExpressionFunction::ParameterList()
<< QgsExpressionFunction::Parameter( QStringLiteral( "layer" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "expression" ), true, QVariant(), true )
<< QgsExpressionFunction::Parameter( QStringLiteral( "filter" ), true, QVariant(), true )
Expand Down

0 comments on commit 1258afe

Please sign in to comment.