Merge pull request #39174 from DelazJ/overlayOnly

Rename geometry_overlay_* functions into overlay_*
This commit is contained in:
Matthias Kuhn 2020-10-09 17:55:27 +02:00 committed by GitHub
commit 1258afe635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 101 additions and 101 deletions

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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.",
@ -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']"
}
]

View File

@ -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() )
@ -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 )

View File

@ -116,44 +116,44 @@ void TestQgsOverlayExpression::testOverlay_data()
QTest::addColumn<QString>( "geometry" );
QTest::addColumn<bool>( "expectedResult" );
QTest::newRow( "intersects" ) << "geometry_overlay_intersects('rectangles')" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << true;
QTest::newRow( "intersects [cached]" ) << "geometry_overlay_intersects('rectangles',cache:=true)" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << true;
QTest::newRow( "intersects" ) << "overlay_intersects('rectangles')" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << true;
QTest::newRow( "intersects [cached]" ) << "overlay_intersects('rectangles',cache:=true)" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << true;
QTest::newRow( "intersects no match" ) << "geometry_overlay_intersects('rectangles')" << "POLYGON((10 0, 5 0, 5 5, 10 5, 10 0))" << false;
QTest::newRow( "intersects no match [cached]" ) << "geometry_overlay_intersects('rectangles',cache:=true)" << "POLYGON((10 0, 5 0, 5 5, 10 5, 10 0))" << false;
QTest::newRow( "intersects no match" ) << "overlay_intersects('rectangles')" << "POLYGON((10 0, 5 0, 5 5, 10 5, 10 0))" << false;
QTest::newRow( "intersects no match [cached]" ) << "overlay_intersects('rectangles',cache:=true)" << "POLYGON((10 0, 5 0, 5 5, 10 5, 10 0))" << false;
QTest::newRow( "touches" ) << "geometry_overlay_touches('rectangles')" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << true;
QTest::newRow( "touches [cached]" ) << "geometry_overlay_touches('rectangles',cache:=true)" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << true;
QTest::newRow( "touches" ) << "overlay_touches('rectangles')" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << true;
QTest::newRow( "touches [cached]" ) << "overlay_touches('rectangles',cache:=true)" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << true;
QTest::newRow( "touches no intersects no match" ) << "geometry_overlay_touches('rectangles')" << "POLYGON((-86 54, -95 51, -81 51, -86 54))" << false;
QTest::newRow( "touches no intersects no match [cached]" ) << "geometry_overlay_touches('rectangles',cache:=true)" << "POLYGON((-86 54, -95 51, -81 51, -86 54))" << false;
QTest::newRow( "touches no intersects no match" ) << "overlay_touches('rectangles')" << "POLYGON((-86 54, -95 51, -81 51, -86 54))" << false;
QTest::newRow( "touches no intersects no match [cached]" ) << "overlay_touches('rectangles',cache:=true)" << "POLYGON((-86 54, -95 51, -81 51, -86 54))" << false;
QTest::newRow( "touches intersects no match" ) << "geometry_overlay_touches('rectangles')" << "POLYGON((-86 54, -95 49, -81 49, -86 54))" << false;
QTest::newRow( "touches intersects no match [cached]" ) << "geometry_overlay_touches('rectangles',cache:=true)" << "POLYGON((-86 54, -95 49, -81 49, -86 54))" << false;
QTest::newRow( "touches intersects no match" ) << "overlay_touches('rectangles')" << "POLYGON((-86 54, -95 49, -81 49, -86 54))" << false;
QTest::newRow( "touches intersects no match [cached]" ) << "overlay_touches('rectangles',cache:=true)" << "POLYGON((-86 54, -95 49, -81 49, -86 54))" << false;
QTest::newRow( "within" ) << "geometry_overlay_within('rectangles')" << "POINT(-83 47)" << true;
QTest::newRow( "within [cached]" ) << "geometry_overlay_within('rectangles',cache:=true)" << "POINT(-83 47)" << true;
QTest::newRow( "within" ) << "overlay_within('rectangles')" << "POINT(-83 47)" << true;
QTest::newRow( "within [cached]" ) << "overlay_within('rectangles',cache:=true)" << "POINT(-83 47)" << true;
QTest::newRow( "within no match" ) << "geometry_overlay_within('rectangles')" << "POINT(-122 43)" << false;
QTest::newRow( "within no match [cached]" ) << "geometry_overlay_within('rectangles',cache:=true)" << "POINT(-122 43)" << false;
QTest::newRow( "within no match" ) << "overlay_within('rectangles')" << "POINT(-122 43)" << false;
QTest::newRow( "within no match [cached]" ) << "overlay_within('rectangles',cache:=true)" << "POINT(-122 43)" << false;
QTest::newRow( "contains" ) << "geometry_overlay_contains('rectangles')" << "POLYGON((-166 15, -166 58, -107 58, -107 15, -166 15))" << true;
QTest::newRow( "contains [cached]" ) << "geometry_overlay_contains('rectangles',cache:=true)" << "POLYGON((-166 15, -166 58, -107 58, -107 15, -166 15))" << true;
QTest::newRow( "contains" ) << "overlay_contains('rectangles')" << "POLYGON((-166 15, -166 58, -107 58, -107 15, -166 15))" << true;
QTest::newRow( "contains [cached]" ) << "overlay_contains('rectangles',cache:=true)" << "POLYGON((-166 15, -166 58, -107 58, -107 15, -166 15))" << true;
QTest::newRow( "contains no match" ) << "geometry_overlay_contains('rectangles')" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "contains no match [cached]" ) << "geometry_overlay_contains('rectangles',cache:=true)" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "contains no match" ) << "overlay_contains('rectangles')" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "contains no match [cached]" ) << "overlay_contains('rectangles',cache:=true)" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "equals" ) << "geometry_overlay_equals('rectangles')" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << true;
QTest::newRow( "equals [cached]" ) << "geometry_overlay_equals('rectangles',cache:=true)" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << true;
QTest::newRow( "equals" ) << "overlay_equals('rectangles')" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << true;
QTest::newRow( "equals [cached]" ) << "overlay_equals('rectangles',cache:=true)" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << true;
QTest::newRow( "equals no match" ) << "geometry_overlay_equals('rectangles')" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "equals no match [cached]" ) << "geometry_overlay_equals('rectangles',cache:=true)" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "equals no match" ) << "overlay_equals('rectangles')" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "equals no match [cached]" ) << "overlay_equals('rectangles',cache:=true)" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "disjoint" ) << "geometry_overlay_disjoint('rectangles')" << "LINESTRING(-155 15, -122 55, -84 4)" << true;
QTest::newRow( "disjoint [cached]" ) << "geometry_overlay_disjoint('rectangles',cache:=true)" << "LINESTRING(-155 15, -122 55, -84 4)" << true;
QTest::newRow( "disjoint" ) << "overlay_disjoint('rectangles')" << "LINESTRING(-155 15, -122 55, -84 4)" << true;
QTest::newRow( "disjoint [cached]" ) << "overlay_disjoint('rectangles',cache:=true)" << "LINESTRING(-155 15, -122 55, -84 4)" << true;
QTest::newRow( "disjoint no match" ) << "geometry_overlay_disjoint('rectangles')" << "LINESTRING(-155 15, -122 32, -84 4)" << false;
QTest::newRow( "disjoint no match [cached]" ) << "geometry_overlay_disjoint('rectangles',cache:=true)" << "LINESTRING(-155 15, -122 32, -84 4)" << false;
QTest::newRow( "disjoint no match" ) << "overlay_disjoint('rectangles')" << "LINESTRING(-155 15, -122 32, -84 4)" << false;
QTest::newRow( "disjoint no match [cached]" ) << "overlay_disjoint('rectangles',cache:=true)" << "LINESTRING(-155 15, -122 32, -84 4)" << false;
}
void TestQgsOverlayExpression::testOverlayExpression()
@ -184,44 +184,44 @@ void TestQgsOverlayExpression::testOverlayExpression_data()
QTest::addColumn<QString>( "geometry" );
QTest::addColumn<QVariantList>( "expectedResult" );
QTest::newRow( "intersects get geometry" ) << "geometry_overlay_intersects('rectangles', geom_to_wkt($geometry))" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << QVariantList { QVariant( QStringLiteral( "MultiPolygon (((-130 40, -115 40, -115 25, -130 25, -130 40)))" ) ) };
QTest::newRow( "intersects get geometry [cached]" ) << "geometry_overlay_intersects('rectangles', geom_to_wkt($geometry),cache:=true)" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << QVariantList { QVariant( QStringLiteral( "MultiPolygon (((-130 40, -115 40, -115 25, -130 25, -130 40)))" ) ) };
QTest::newRow( "intersects get geometry" ) << "overlay_intersects('rectangles', geom_to_wkt($geometry))" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << QVariantList { QVariant( QStringLiteral( "MultiPolygon (((-130 40, -115 40, -115 25, -130 25, -130 40)))" ) ) };
QTest::newRow( "intersects get geometry [cached]" ) << "overlay_intersects('rectangles', geom_to_wkt($geometry),cache:=true)" << "POLYGON((-120 30, -105 30, -105 20, -120 20, -120 30))" << QVariantList { QVariant( QStringLiteral( "MultiPolygon (((-130 40, -115 40, -115 25, -130 25, -130 40)))" ) ) };
QTest::newRow( "intersects get ids" ) << "geometry_overlay_intersects('rectangles', id)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2, 3 };
QTest::newRow( "intersects get ids [cached]" ) << "geometry_overlay_intersects('rectangles', id,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2, 3 };
QTest::newRow( "intersects get ids" ) << "overlay_intersects('rectangles', id)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2, 3 };
QTest::newRow( "intersects get ids [cached]" ) << "overlay_intersects('rectangles', id,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2, 3 };
QTest::newRow( "intersects get ids limit 2" ) << "geometry_overlay_intersects('rectangles', id, limit:=2)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2 };
QTest::newRow( "intersects get ids limit 2 [cached]" ) << "geometry_overlay_intersects('rectangles', id, limit:=2,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2 };
QTest::newRow( "intersects get ids limit 2" ) << "overlay_intersects('rectangles', id, limit:=2)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2 };
QTest::newRow( "intersects get ids limit 2 [cached]" ) << "overlay_intersects('rectangles', id, limit:=2,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 2 };
QTest::newRow( "intersects filtered get ids" ) << "geometry_overlay_intersects('rectangles', id, id!=2)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 3 };
QTest::newRow( "intersects filtered get ids [cached]" ) << "geometry_overlay_intersects('rectangles', id, id!=2,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 3 };
QTest::newRow( "intersects filtered get ids" ) << "overlay_intersects('rectangles', id, id!=2)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 3 };
QTest::newRow( "intersects filtered get ids [cached]" ) << "overlay_intersects('rectangles', id, id!=2,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 1, 3 };
QTest::newRow( "intersects filtered get ids limit 1" ) << "geometry_overlay_intersects('rectangles', id, id!=1, 1)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 2 };
QTest::newRow( "intersects filtered get ids limit 1 [cached]" ) << "geometry_overlay_intersects('rectangles', id, id!=1, 1,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 2 };
QTest::newRow( "intersects filtered get ids limit 1" ) << "overlay_intersects('rectangles', id, id!=1, 1)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 2 };
QTest::newRow( "intersects filtered get ids limit 1 [cached]" ) << "overlay_intersects('rectangles', id, id!=1, 1,cache:=true)" << "LINESTRING(-178 52, -133 33, -64 46)" << QVariantList { 2 };
QTest::newRow( "touches get ids" ) << "geometry_overlay_touches('rectangles',id)" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << QVariantList { 3 };
QTest::newRow( "touches get ids [cached]" ) << "geometry_overlay_touches('rectangles',id,cache:=true)" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << QVariantList { 3 };
QTest::newRow( "touches get ids" ) << "overlay_touches('rectangles',id)" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << QVariantList { 3 };
QTest::newRow( "touches get ids [cached]" ) << "overlay_touches('rectangles',id,cache:=true)" << "POLYGON((-86 54, -95 50, -81 50, -86 54))" << QVariantList { 3 };
QTest::newRow( "equals get ids" ) << "geometry_overlay_equals('rectangles',id)" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << QVariantList { 1 };
QTest::newRow( "equals get ids [cached]" ) << "geometry_overlay_equals('rectangles',id,cache:=true)" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << QVariantList { 1 };
QTest::newRow( "equals get ids" ) << "overlay_equals('rectangles',id)" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << QVariantList { 1 };
QTest::newRow( "equals get ids [cached]" ) << "overlay_equals('rectangles',id,cache:=true)" << "MULTIPOLYGON(((-160 50, -145 50, -145 35, -160 35, -160 50)))" << QVariantList { 1 };
QTest::newRow( "disjoint get ids" ) << "geometry_overlay_disjoint('rectangles',id)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2, 3 };
QTest::newRow( "disjoint get ids [cached]" ) << "geometry_overlay_disjoint('rectangles',id,cache:=true)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2, 3 };
QTest::newRow( "disjoint get ids" ) << "overlay_disjoint('rectangles',id)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2, 3 };
QTest::newRow( "disjoint get ids [cached]" ) << "overlay_disjoint('rectangles',id,cache:=true)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2, 3 };
QTest::newRow( "disjoint get ids limit 2" ) << "geometry_overlay_disjoint('rectangles',id, limit:=2)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2 };
QTest::newRow( "disjoint get ids limit 2 [cached]" ) << "geometry_overlay_disjoint('rectangles',id, limit:=2,cache:=true)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2 };
QTest::newRow( "disjoint get ids limit 2" ) << "overlay_disjoint('rectangles',id, limit:=2)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2 };
QTest::newRow( "disjoint get ids limit 2 [cached]" ) << "overlay_disjoint('rectangles',id, limit:=2,cache:=true)" << "LINESTRING(-155 15, -122 55, -84 4)" << QVariantList { 1, 2 };
QTest::newRow( "nearest" ) << "geometry_overlay_nearest('rectangles',id)" << "POINT(-135 38)" << QVariantList { 2 };
QTest::newRow( "nearest [cached]" ) << "geometry_overlay_nearest('rectangles',id,cache:=true)" << "POINT(-135 38)" << QVariantList { 2 };
QTest::newRow( "nearest" ) << "overlay_nearest('rectangles',id)" << "POINT(-135 38)" << QVariantList { 2 };
QTest::newRow( "nearest [cached]" ) << "overlay_nearest('rectangles',id,cache:=true)" << "POINT(-135 38)" << QVariantList { 2 };
QTest::newRow( "nearest filtered" ) << "geometry_overlay_nearest('rectangles',id,id!=2)" << "POINT(-135 38)" << QVariantList { 1 };
QTest::newRow( "nearest filtered [cached]" ) << "geometry_overlay_nearest('rectangles',id,id!=2,cache:=true)" << "POINT(-135 38)" << QVariantList { 1 };
QTest::newRow( "nearest filtered" ) << "overlay_nearest('rectangles',id,id!=2)" << "POINT(-135 38)" << QVariantList { 1 };
QTest::newRow( "nearest filtered [cached]" ) << "overlay_nearest('rectangles',id,id!=2,cache:=true)" << "POINT(-135 38)" << QVariantList { 1 };
QTest::newRow( "nearest limited" ) << "geometry_overlay_nearest('rectangles',id,limit:=2)" << "POINT(-135 38)" << QVariantList { 2, 1 };
QTest::newRow( "nearest limited [cached]" ) << "geometry_overlay_nearest('rectangles',id,limit:=2,cache:=true)" << "POINT(-135 38)" << QVariantList { 2, 1 };
QTest::newRow( "nearest limited" ) << "overlay_nearest('rectangles',id,limit:=2)" << "POINT(-135 38)" << QVariantList { 2, 1 };
QTest::newRow( "nearest limited [cached]" ) << "overlay_nearest('rectangles',id,limit:=2,cache:=true)" << "POINT(-135 38)" << QVariantList { 2, 1 };
QTest::newRow( "nearest limited filtered" ) << "geometry_overlay_nearest('rectangles',id,id!=2,limit:=2)" << "POINT(-135 38)" << QVariantList { 1, 3 };
QTest::newRow( "nearest limited filtered [cached]" ) << "geometry_overlay_nearest('rectangles',id,id!=2,limit:=2,cache:=true)" << "POINT(-135 38)" << QVariantList { 1, 3 };
QTest::newRow( "nearest limited filtered" ) << "overlay_nearest('rectangles',id,id!=2,limit:=2)" << "POINT(-135 38)" << QVariantList { 1, 3 };
QTest::newRow( "nearest limited filtered [cached]" ) << "overlay_nearest('rectangles',id,id!=2,limit:=2,cache:=true)" << "POINT(-135 38)" << QVariantList { 1, 3 };
}
@ -231,7 +231,7 @@ void TestQgsOverlayExpression::testOverlaySelf()
context.appendScope( QgsExpressionContextUtils::projectScope( QgsProject::instance() ) );
context.appendScope( QgsExpressionContextUtils::layerScope( mPolyLayer ) );
QgsExpression exp( "geometry_overlay_intersects('polys')" );
QgsExpression exp( "overlay_intersects('polys')" );
QVERIFY2( exp.prepare( &context ), exp.parserErrorString().toUtf8().constData() );
QgsFeature feat;