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

5 comments on commit ff5a8bc

@marioba
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marioba is that a change from 2.18?

@marioba
Copy link
Contributor

@marioba marioba commented on ff5a8bc Nov 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.