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
This commit is contained in:
Nyall Dawson 2018-11-09 12:34:28 +10:00
parent 30cf2d37bc
commit ff5a8bc0ae

View File

@ -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() &&