Skip to content

Commit ff5a8bc

Browse files
committedNov 9, 2018
Revert "[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geometries"
This reverts commit e05a5a9. The makeValid call is much slower than the previous "buffer( 0 )" approach Fixes #20260
1 parent 30cf2d3 commit ff5a8bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/core/qgspallabeling.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,13 +2976,13 @@ QgsGeometry QgsPalLabeling::prepareGeometry( const QgsGeometry &geometry, QgsRen
29762976
// fix invalid polygons
29772977
if ( geom.type() == QgsWkbTypes::PolygonGeometry && !geom.isGeosValid() )
29782978
{
2979-
QgsGeometry validGeom = geom.makeValid();
2980-
if ( validGeom.isNull() )
2979+
QgsGeometry bufferGeom = geom.buffer( 0, 0 );
2980+
if ( bufferGeom.isNull() )
29812981
{
2982-
QgsDebugMsg( QStringLiteral( "Could not repair geometry: %1" ).arg( validGeom.lastError() ) );
2982+
QgsDebugMsg( QStringLiteral( "Could not repair geometry: %1" ).arg( bufferGeom.lastError() ) );
29832983
return QgsGeometry();
29842984
}
2985-
geom = validGeom;
2985+
geom = bufferGeom;
29862986
}
29872987

29882988
if ( !clipGeometry.isNull() &&

5 commit comments

Comments
 (5)

marioba commented on Nov 27, 2018

@marioba
Contributor

Hi @nyalldawson,
thanks for the fix.
The problem seems to be solved in the main canvas, but I have a similar problem in the layout manager when it renders the map.
Do you think it's the same problem with a similar simple solution?

nyalldawson commented on Nov 27, 2018

@nyalldawson
CollaboratorAuthor

@marioba The same change applied to both the canvas and layout, it's the same code used to render the labels for both areas

marioba commented on Nov 27, 2018

@marioba
Contributor

Ok, but strange because it seems the same problem: with the labels around the centroid activated, in the layout it takes a lot to render the map.

nyalldawson commented on Nov 27, 2018

@nyalldawson
CollaboratorAuthor

@marioba is that a change from 2.18?

marioba commented on Nov 28, 2018

@marioba
Contributor

In 2.18 I see the map rendering in the layout manager, in QGIS 3 master, no (only the text "rendering map").
But if I do export a pdf from the layout manager, neither of them can do it in a reasonable time.

Please sign in to comment.