@@ -4538,7 +4538,7 @@ void TestQgsGeometry::lineString()
45384538 filterLine.filterVertices( filter ); // no crash
45394539 filterLine.setPoints( QgsPointSequence() << QgsPoint( 11, 2, 3, 4, QgsWkbTypes::PointZM ) << QgsPoint( 1, 2, 3, 4, QgsWkbTypes::PointZM ) << QgsPoint( 4, 12, 13, 14, QgsWkbTypes::PointZM ) << QgsPoint( 111, 12, 23, 24, QgsWkbTypes::PointZM ) );
45404540 filterLine.filterVertices( filter );
4541- QCOMPARE( swapLine .asWkt( 2 ), QStringLiteral( "LineStringZM (2 11 3 4, 12 11 13 14, 12 111 23 24 )" ) );
4541+ QCOMPARE( filterLine .asWkt( 2 ), QStringLiteral( "LineStringZM (1 2 3 4, 4 12 13 14)" ) );
45424542}
45434543
45444544void TestQgsGeometry::polygon()
@@ -11583,6 +11583,20 @@ void TestQgsGeometry::multiPoint()
1158311583 mp.addGeometry( new QgsPoint( QgsWkbTypes::PointZM, 10, 1, 4, 8 ) );
1158411584 QVERIFY( !mp.removeDuplicateNodes() );
1158511585 QCOMPARE( mp.numGeometries(), 2 );
11586+
11587+ // filter vertex
11588+ QgsMultiPoint filterPoint;
11589+ auto filter = []( const QgsPoint & point )-> bool
11590+ {
11591+ return point.x() < 5;
11592+ };
11593+ filterPoint.filterVertices( filter ); // no crash
11594+ filterPoint.addGeometry( new QgsPoint( QgsWkbTypes::PointZM, 10, 0, 4, 8 ) );
11595+ filterPoint.addGeometry( new QgsPoint( QgsWkbTypes::PointZM, 3, 0, 4, 8 ) );
11596+ filterPoint.addGeometry( new QgsPoint( QgsWkbTypes::PointZM, 1, 0, 4, 8 ) );
11597+ filterPoint.addGeometry( new QgsPoint( QgsWkbTypes::PointZM, 11, 0, 4, 8 ) );
11598+ filterPoint.filterVertices( filter );
11599+ QCOMPARE( filterPoint.asWkt( 2 ), QStringLiteral( "MultiPointZM ((3 0 4 8),(1 0 4 8))" ) );
1158611600}
1158711601
1158811602void TestQgsGeometry::multiLineString()
0 commit comments