Skip to content
Permalink
Browse files

[Processing] Make DeleteHoles algorithm NULL geometry aware

  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent cd10c6c commit 1205082269ab9c4f7f8d56f0d7705b2812367d44
Showing with 12 additions and 9 deletions.
  1. +12 −9 python/plugins/processing/algs/qgis/DeleteHoles.py
@@ -60,18 +60,21 @@ def processAlgorithm(self, progress):
for count, f in enumerate(features):

geometry = f.geometry()
if geometry.isMultipart():
multi_polygon = geometry.asMultiPolygon()
for polygon in multi_polygon:
if geometry:
if geometry.isMultipart():
multi_polygon = geometry.asMultiPolygon()
for polygon in multi_polygon:
for ring in polygon[1:]:
polygon.remove(ring)
geometry = QgsGeometry.fromMultiPolygon(multi_polygon)

else:
polygon = geometry.asPolygon()
for ring in polygon[1:]:
polygon.remove(ring)
geometry = QgsGeometry.fromMultiPolygon(multi_polygon)

geometry = QgsGeometry.fromPolygon(polygon)
else:
polygon = geometry.asPolygon()
for ring in polygon[1:]:
polygon.remove(ring)
geometry = QgsGeometry.fromPolygon(polygon)
geometry = QgsGeometry(None)

feat.setGeometry(geometry)
feat.setAttributes(f.attributes())

0 comments on commit 1205082

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