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
  • Loading branch information
nyalldawson committed Nov 9, 2018
1 parent 30cf2d3 commit ff5a8bc0aebf51cd34c82ed0feaac21cbd22e2ce
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() &&

5 comments on commit ff5a8bc

@marioba

This comment has been minimized.

Copy link
Contributor

@marioba marioba replied Nov 27, 2018

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

This comment has been minimized.

Copy link
Collaborator Author

@nyalldawson nyalldawson replied Nov 27, 2018

@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

This comment has been minimized.

Copy link
Contributor

@marioba marioba replied Nov 27, 2018

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

This comment has been minimized.

Copy link
Collaborator Author

@nyalldawson nyalldawson replied Nov 27, 2018

@marioba is that a change from 2.18?

@marioba

This comment has been minimized.

Copy link
Contributor

@marioba marioba replied Nov 28, 2018

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.
You can’t perform that action at this time.