Skip to content
Permalink
Browse files

[geometry fixer] PR review

(cherry picked from commit e79f9a9)
  • Loading branch information
olivierdalang authored and nyalldawson committed Nov 20, 2020
1 parent 643648c commit 7eb610e579b6cd2c3b3c9725813721c4c0e3ea6d
@@ -393,7 +393,7 @@ bool QgsGeometryGapCheck::mergeWithNeighbor( const QMap<QString, QgsFeaturePool
while ( neighbourIterator.hasNext() )
{
QgsPoint neighbourPt = neighbourIterator.next();
double dist = pt.distance( neighbourPt );
double dist = pt.distanceSquared( neighbourPt );
if ( nearestDist == -1 || dist < nearestDist )
{
nearestDist = dist;
@@ -154,7 +154,6 @@ void QgsGeometryOverlapCheck::fixError( const QMap<QString, QgsFeaturePool *> &f
else if ( method == Subtract )
{
std::unique_ptr< QgsGeometryEngine > geomEngineDiffA = QgsGeometryCheckerUtils::createGeomEngine( geometryA.constGet(), 0 );
geomEngineDiffA->prepareGeometry();
std::unique_ptr< QgsAbstractGeometry > diff1( geomEngineDiffA->difference( interPart, &errMsg ) );
if ( !diff1 || diff1->isEmpty() )
{
@@ -165,7 +164,6 @@ void QgsGeometryOverlapCheck::fixError( const QMap<QString, QgsFeaturePool *> &f
QgsGeometryCheckerUtils::filter1DTypes( diff1.get() );
}
std::unique_ptr< QgsGeometryEngine > geomEngineDiffB = QgsGeometryCheckerUtils::createGeomEngine( geometryB.constGet(), 0 );
geomEngineDiffB->prepareGeometry();
std::unique_ptr< QgsAbstractGeometry > diff2( geomEngineDiffB->difference( interPart, &errMsg ) );
if ( !diff2 || diff2->isEmpty() )
{
@@ -1245,9 +1245,11 @@ void TestQgsGeometryChecks::testOverlapCheckToleranceBug()
double areaOld = f.geometry().area();
QgsPoint pointOld_1 = f.geometry().vertexAt( 1 );
QgsPoint pointOld_2 = f.geometry().vertexAt( 2 );

// Just making sure we've got the right feature/point
QCOMPARE( areaOld, 10442.710061549426 );
QCOMPARE( pointOld_1, QgsPoint( 2537221.53079314017668366, 1152360.02460834058001637 ) );
QCOMPARE( pointOld_2, QgsPoint( 2537366.84566075634211302, 1152360.28978145681321621 ) );
QGSCOMPARENEARPOINT( pointOld_1, QgsPoint( 2537221.53079314017668366, 1152360.02460834058001637 ), 0.00001 );
QGSCOMPARENEARPOINT( pointOld_2, QgsPoint( 2537366.84566075634211302, 1152360.28978145681321621 ), 0.00001 );

QgsGeometryCheck::Changes changes;
QMap<QString, int> mergeAttrs;

0 comments on commit 7eb610e

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