Navigation Menu

Skip to content

Commit

Permalink
Revert "[pal] Use QgsGeometry::makeValid instead of buffer(0) to repa…
Browse files Browse the repository at this point in the history
…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 10, 2018
1 parent 2b4dc92 commit 62d0bae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgspallabeling.cpp
Expand Up @@ -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() &&
Expand Down

0 comments on commit 62d0bae

Please sign in to comment.