Skip to content
Permalink
Browse files

Add failing test for rendering simplification of very small

ring inside larger polygon
  • Loading branch information
nyalldawson committed May 21, 2018
1 parent b886e22 commit 981178399af1039a97c4785734a8b149a23e5001
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/src/core/testqgsmaptopixelgeometrysimplifier.cpp
@@ -76,6 +76,7 @@ class TestQgsMapToPixelGeometrySimplifier : public QObject
void testWkbDimensionMismatch();
void testCircularString();
void testVisvalingam();
void testRingValidity();

};

@@ -205,5 +206,16 @@ void TestQgsMapToPixelGeometrySimplifier::testVisvalingam()
QCOMPARE( simplifier.simplify( g ).asWkt(), expectedWkt );
}

void TestQgsMapToPixelGeometrySimplifier::testRingValidity()
{
QgsGeometry poly = QgsGeometry::fromWkt( QStringLiteral( "Polygon ((0 0, 30 0, 30 30, 0 30, 0 0),(10.0001 10.00002, 10.0005 10.00002, 10.0005 10.00004, 10.00001 10.00004, 10.0001 10.00002 ))" ) );

int fl = QgsMapToPixelSimplifier::SimplifyGeometry | QgsMapToPixelSimplifier::SimplifyEnvelope;
QgsMapToPixelSimplifier simplifier( fl, 5 );
QgsGeometry ret = simplifier.simplify( poly );
QVERIFY( ret.isGeosValid() );

}

QGSTEST_MAIN( TestQgsMapToPixelGeometrySimplifier )
#include "testqgsmaptopixelgeometrysimplifier.moc"

0 comments on commit 9811783

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