From ff5a8bc0aebf51cd34c82ed0feaac21cbd22e2ce Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 9 Nov 2018 12:34:28 +1000 Subject: [PATCH] Revert "[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geometries" This reverts commit e05a5a930241ec3c9c5df7880650da60382b956c. The makeValid call is much slower than the previous "buffer( 0 )" approach Fixes #20260 --- src/core/qgspallabeling.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 7df9f9922957..c1c455d718dc 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -2976,13 +2976,13 @@ QgsGeometry QgsPalLabeling::prepareGeometry( const QgsGeometry &geometry, QgsRen // fix invalid polygons if ( geom.type() == QgsWkbTypes::PolygonGeometry && !geom.isGeosValid() ) { - QgsGeometry validGeom = geom.makeValid(); - if ( validGeom.isNull() ) + QgsGeometry bufferGeom = geom.buffer( 0, 0 ); + if ( bufferGeom.isNull() ) { - QgsDebugMsg( QStringLiteral( "Could not repair geometry: %1" ).arg( validGeom.lastError() ) ); + QgsDebugMsg( QStringLiteral( "Could not repair geometry: %1" ).arg( bufferGeom.lastError() ) ); return QgsGeometry(); } - geom = validGeom; + geom = bufferGeom; } if ( !clipGeometry.isNull() &&