qgis/QGIS — pull request #1241 by ahuarte47 (2014-03-14 11:24:51+00:00)
Title: Fux bug 9777: Simplification of polygons may return invalid polygons

This pull fixes the bug 9777 (http://hub.qgis.org/issues/9777).

I added a new method to QgsGeometry class to enable the validation of a geometry when it is required export it to GEOS geometry. It ensures the simplified geometries are valid. The simplification code enables this new flag, disabled by default, when a geometry is simplified (No generalized by its bounding box).

The validation code is only executed when needed, drawing labels of a simplified geometry, or any code requires the GEOS geometry and this flag is enabled. If a simplified geometry is drawed without internally call to 'exportWkbToGeos()', as usual, then the validation is not executed and there is no penalty in the performance.