Skip to content

Commit 9811783

Browse files
committed
Add failing test for rendering simplification of very small
ring inside larger polygon
1 parent b886e22 commit 9811783

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/src/core/testqgsmaptopixelgeometrysimplifier.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class TestQgsMapToPixelGeometrySimplifier : public QObject
7676
void testWkbDimensionMismatch();
7777
void testCircularString();
7878
void testVisvalingam();
79+
void testRingValidity();
7980

8081
};
8182

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

209+
void TestQgsMapToPixelGeometrySimplifier::testRingValidity()
210+
{
211+
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 ))" ) );
212+
213+
int fl = QgsMapToPixelSimplifier::SimplifyGeometry | QgsMapToPixelSimplifier::SimplifyEnvelope;
214+
QgsMapToPixelSimplifier simplifier( fl, 5 );
215+
QgsGeometry ret = simplifier.simplify( poly );
216+
QVERIFY( ret.isGeosValid() );
217+
218+
}
219+
208220
QGSTEST_MAIN( TestQgsMapToPixelGeometrySimplifier )
209221
#include "testqgsmaptopixelgeometrysimplifier.moc"

0 commit comments

Comments
 (0)