Skip to content
Permalink
Browse files

[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geome…

…tries

Possibly refs #14752
  • Loading branch information
nyalldawson committed Mar 2, 2018
1 parent 70242a3 commit e05a5a930241ec3c9c5df7880650da60382b956c
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgspallabeling.cpp
@@ -2931,12 +2931,12 @@ QgsGeometry QgsPalLabeling::prepareGeometry( const QgsGeometry &geometry, QgsRen
// fix invalid polygons
if ( geom.type() == QgsWkbTypes::PolygonGeometry && !geom.isGeosValid() )
{
QgsGeometry bufferGeom = geom.buffer( 0, 0 );
if ( bufferGeom.isNull() )
QgsGeometry validGeom = geom.makeValid();
if ( validGeom.isNull() )
{
return QgsGeometry();
}
geom = bufferGeom;
geom = validGeom;
}

if ( !clipGeometry.isNull() &&

0 comments on commit e05a5a9

Please sign in to comment.
You can’t perform that action at this time.