Skip to content
Permalink
Browse files

[processing] Fix non-sequential ids in regular points algorithm

  • Loading branch information
nyalldawson committed Aug 14, 2018
1 parent f769430 commit 9d6b5a7f5331ba92840acba158c52dccd68fbbc8
Showing with 3 additions and 1 deletion.
  1. +3 −1 python/plugins/processing/algs/qgis/RegularPoints.py
@@ -130,6 +130,7 @@ def processAlgorithm(self, parameters, context, feedback):
f.setFields(fields)

count = 0
id = 0
total = 100.0 / (area / pSpacing)
y = extent.yMaximum() - inset

@@ -151,10 +152,11 @@ def processAlgorithm(self, parameters, context, feedback):
geom = QgsGeometry().fromPointXY(QgsPointXY(x, y))

if extent_engine.intersects(geom.constGet()):
f.setAttribute('id', count)
f.setAttributes([id])
f.setGeometry(geom)
sink.addFeature(f, QgsFeatureSink.FastInsert)
x += pSpacing
id += 1

count += 1
feedback.setProgress(int(count * total))

0 comments on commit 9d6b5a7

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