Skip to content
Permalink
Browse files

[processing] Fix invalid geometries made by densify when input geom i…

…s null
  • Loading branch information
nyalldawson committed Nov 6, 2016
1 parent e426dbc commit eefa7115bf2f34ac052e7d977db89d533f7ea306
@@ -72,13 +72,11 @@ def processAlgorithm(self, progress):
features = vector.features(layer)
total = 100.0 / len(features)
for current, f in enumerate(features):
featGeometry = f.geometry()
attrs = f.attributes()
newGeometry = self.densifyGeometry(featGeometry, int(vertices),
isPolygon)
feature = QgsFeature()
feature.setGeometry(newGeometry)
feature.setAttributes(attrs)
feature = f
if feature.hasGeometry():
new_geometry = self.densifyGeometry(feature.geometry(), int(vertices),
isPolygon)
feature.setGeometry(new_geometry)
writer.addFeature(feature)
progress.setPercentage(int(current * total))

@@ -69,13 +69,11 @@ def processAlgorithm(self, progress):
features = vector.features(layer)
total = 100.0 / len(features)
for current, f in enumerate(features):
featGeometry = f.geometry()
attrs = f.attributes()
newGeometry = self.densifyGeometry(featGeometry, interval,
isPolygon)
feature = QgsFeature()
feature.setGeometry(newGeometry)
feature.setAttributes(attrs)
feature = f
if feature.hasGeometry():
new_geometry = self.densifyGeometry(feature.geometry(), interval,
isPolygon)
feature.setGeometry(new_geometry)
writer.addFeature(feature)

progress.setPercentage(int(current * total))

0 comments on commit eefa711

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