Skip to content

Commit

Permalink
Add failing test for rendering simplification of very small
Browse files Browse the repository at this point in the history
ring inside larger polygon
  • Loading branch information
nyalldawson committed May 22, 2018
1 parent b886e22 commit 9811783
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/core/testqgsmaptopixelgeometrysimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class TestQgsMapToPixelGeometrySimplifier : public QObject
void testWkbDimensionMismatch();
void testCircularString();
void testVisvalingam();
void testRingValidity();

};

Expand Down Expand Up @@ -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.