Skip to content
Permalink
Browse files

Revert "[pal] Use QgsGeometry::makeValid instead of buffer(0) to repa…

…ir geometries"

This reverts commit e05a5a9.

The makeValid call is much slower than the previous "buffer( 0 )" approach

Fixes #20260

(cherry picked from commit ff5a8bc)
  • Loading branch information
nyalldawson committed Nov 9, 2018
1 parent 2b4dc92 commit 62d0bae6e2563a48b9e78d5024435b89da751099
Showing with 4 additions and 4 deletions.
  1. +4 −4 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() &&

0 comments on commit 62d0bae

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