Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2192 from Gustry/fix-13067
fix #13067 : bad geometries in the difference tool
  • Loading branch information
jef-n committed Jul 3, 2015
2 parents 29aaf1b + fe1a032 commit 4fba5ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -893,6 +893,10 @@ def difference( self ):
try:
if diff_geom.intersects( tmpGeom ):
diff_geom = QgsGeometry( diff_geom.difference( tmpGeom ) )
if diff_geom.isGeosEmpty():
GEOS_EXCEPT = False
add = False
break
except:
GEOS_EXCEPT = False
add = False
Expand Down
4 changes: 4 additions & 0 deletions python/plugins/processing/algs/qgis/Difference.py
Expand Up @@ -92,6 +92,10 @@ def processAlgorithm(self, progress):
try:
if diff_geom.intersects(tmpGeom):
diff_geom = QgsGeometry(diff_geom.difference(tmpGeom))
if diff_geom.isGeosEmpty():
GEOS_EXCEPT = False
add = False
break
except:
GEOS_EXCEPT = False
add = False
Expand Down

1 comment on commit 4fba5ff

@timlinux
Copy link
Member

Choose a reason for hiding this comment

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

@Gustry there are more cases where geometry.difference are used - we should treat them all in the same way right? See for example:

diff_geom = QgsGeometry( diff_geom.difference( tmpGeom ) )

(I think there are more than just the above)

Please sign in to comment.