Skip to content
Permalink
Browse files

[refFunctions] fix inversion of geomA and geomB !

  • Loading branch information
olivierdalang committed Sep 9, 2020
1 parent ece763d commit 5213b15789a3a304f10ba97bbb9f057c5ae04283
Showing with 9 additions and 9 deletions.
  1. +1 −1 src/core/expression/qgsexpressionfunction.cpp
  2. +8 −8 tests/src/core/testqgsoverlayexpression.cpp
@@ -5870,7 +5870,7 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
{
QgsFeature feat2 = i.next();

if ( ! relationFunction || ( feat2.geometry().*relationFunction )( geometry ) ) // Calls the method provided as template argument for the function (e.g. QgsGeometry::intersects)
if ( ! relationFunction || ( geometry.*relationFunction )( feat2.geometry() ) ) // Calls the method provided as template argument for the function (e.g. QgsGeometry::intersects)
{
found = true;

@@ -131,17 +131,17 @@ void TestQgsOverlayExpression::testOverlay_data()
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( "within" ) << "geometry_overlay_within('rectangles')" << "POLYGON((-166 15, -166 58, -107 58, -107 15, -166 15))" << true;
QTest::newRow( "within [cached]" ) << "geometry_overlay_within('rectangles',cache:=true)" << "POLYGON((-166 15, -166 58, -107 58, -107 15, -166 15))" << true;
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 no match" ) << "geometry_overlay_within('rectangles')" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
QTest::newRow( "within no match [cached]" ) << "geometry_overlay_within('rectangles',cache:=true)" << "POLYGON((-156 46, -149 46, -148 37, -156 46))" << false;
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( "contains" ) << "geometry_overlay_contains('rectangles')" << "POINT(-83 47)" << true;
QTest::newRow( "contains [cached]" ) << "geometry_overlay_contains('rectangles',cache:=true)" << "POINT(-83 47)" << true;
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 no match" ) << "geometry_overlay_contains('rectangles')" << "POINT(-122 43)" << false;
QTest::newRow( "contains no match [cached]" ) << "geometry_overlay_contains('rectangles',cache:=true)" << "POINT(-122 43)" << false;
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( "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;

0 comments on commit 5213b15

Please sign in to comment.
You can’t perform that action at this time.