Skip to content
Permalink
Browse files

Add some notes to test, additional test with empty line

(cherry picked from commit d6aa46c)
  • Loading branch information
nyalldawson committed Nov 9, 2018
1 parent 549db0a commit b9a1a6c4b8d4d2c7e9c29a1f15a8c3dab07f1cdb
Showing with 9 additions and 0 deletions.
  1. +9 −0 tests/src/geometry_checker/testqgsgeometrychecks.cpp
@@ -40,6 +40,8 @@
#include "qgsgeometryselfintersectioncheck.h"
#include "qgsgeometrysliverpolygoncheck.h"
#include "qgsvectordataproviderfeaturepool.h"
#include "qgsmultilinestring.h"
#include "qgslinestring.h"
#include "qgsproject.h"
#include "qgsfeedback.h"

@@ -927,11 +929,18 @@ void TestQgsGeometryChecks::testSelfContactCheck()

cleanupTestContext( testContext );

// https://issues.qgis.org/issues/20408
// test with a linestring which collapses to an empty linestring
QgsGeometryCheckContext context( 1, QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3857" ) ), QgsCoordinateTransformContext() );
QgsGeometrySelfContactCheck check2( &context, QVariantMap() );
QgsGeometry g = QgsGeometry::fromWkt( QStringLiteral( "MultiLineString ((2988987 10262483, 2988983 10262480, 2988991 10262432, 2988990 10262419, 2988977 10262419, 2988976 10262420, 2988967 10262406, 2988970 10262421, 2988971 10262424),(2995620 10301368))" ) );
QList<QgsSingleGeometryCheckError *> errors = check2.processGeometry( g );
QVERIFY( errors.isEmpty() );

// test with totally empty line
qgsgeometry_cast< QgsMultiLineString * >( g.get() )->addGeometry( new QgsLineString() );
errors = check2.processGeometry( g );
QVERIFY( errors.isEmpty() );
}

void TestQgsGeometryChecks::testSelfIntersectionCheck()

0 comments on commit b9a1a6c

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