From 5b824ac85e86ff4bccc7aeb81a5c48461fcc4def Mon Sep 17 00:00:00 2001 From: ahuarte47 Date: Mon, 3 Mar 2014 23:53:41 +0100 Subject: [PATCH] Fix for #9655: fix invalid polygons with buffer_0 --- src/core/qgspallabeling.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 6a240787f2c3..72ed03de8267 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -1818,6 +1818,12 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f } } + // fix invalid polygons + if ( geom->type() == QGis::Polygon && !geom->isGeosValid() ) + { + geom->fromGeos( GEOSBuffer( geom->asGeos(), 0, 0 ) ); + } + // CLIP the geometry if it is bigger than the extent // don't clip if centroid is requested for whole feature bool do_clip = false;