Skip to content
Permalink
Browse files

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

…tries

Possibly refs #14752

(cherry-picked from e05a5a9)
  • Loading branch information
nyalldawson committed Feb 27, 2018
1 parent fc7b99e commit 23457336a0c37865f2ea670fdfdb29e1a6a15bdb
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 2345733

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