mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
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:
parent
30cf2d37bc
commit
ff5a8bc0ae
@ -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() &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user