Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
|
||
void TestQgsGeometry::splitGeometry() | ||
{ | ||
QgsGeometry g1 = QgsGeometry::fromWkt( QStringLiteral( "Polygon ((492980.38648063864093274 7082334.45244149677455425, 493082.65415841294452548 7082319.87918917648494244, 492980.38648063858272508 7082334.45244149677455425, 492980.38648063864093274 7082334.45244149677455425))" ) ); | ||
QVector<QgsGeometry> newGeoms; | ||
QgsPointSequence testPoints; | ||
QCOMPARE( g1.splitGeometry( QgsPointSequence() << QgsPoint( 493825.46541286131832749, 7082214.02779923938214779 ) << QgsPoint( 492955.04876351181883365, 7082338.06309300474822521 ), | ||
newGeoms, false, testPoints ), QgsGeometry::NothingHappened ); | ||
qDebug() << GEOSversion() << "\n"; | ||
QgsGeometry g1 = QgsGeometry::fromWkt( QStringLiteral( "Polygon ((492980.38648063864093274 7082334.45244149677455425, 493082.65415841294452548 7082319.87918917648494244, 492980.38648063858272508 7082334.45244149677455425, 492980.38648063864093274 7082334.45244149677455425))" ) ); | ||
if ( GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR < 9 ) | ||
{ | ||
QCOMPARE( g1.splitGeometry( QgsPointSequence() << QgsPoint( 493825.46541286131832749, 7082214.02779923938214779 ) << QgsPoint( 492955.04876351181883365, 7082338.06309300474822521 ), | ||
newGeoms, false, testPoints ), QgsGeometry::NothingHappened ); | ||
} | ||
else | ||
{ | ||
QCOMPARE( g1.splitGeometry( QgsPointSequence() << QgsPoint( 493825.46541286131832749, 7082214.02779923938214779 ) << QgsPoint( 492955.04876351181883365, 7082338.06309300474822521 ), | ||
newGeoms, false, testPoints ), QgsGeometry::InvalidBaseGeometry ); | ||
} | ||
QVERIFY( newGeoms.isEmpty() ); | ||
|
||
// Bug https://github.com/qgis/QGIS/issues/33489 |