Skip to content
Permalink
Browse files

[processing] Minor optimization for regular points algorithm

  • Loading branch information
nyalldawson committed Aug 14, 2018
1 parent 9d6b5a7 commit 0faa7ecdaed2c7e421408af5698422d013ec839e
Showing with 3 additions and 4 deletions.
  1. +3 −4 python/plugins/processing/algs/qgis/RegularPoints.py
@@ -38,12 +38,11 @@
QgsFeature,
QgsWkbTypes,
QgsGeometry,
QgsPointXY,
QgsPoint,
QgsProcessing,
QgsProcessingException,
QgsProcessingParameterDistance,
QgsProcessingParameterExtent,
QgsProcessingParameterNumber,
QgsProcessingParameterBoolean,
QgsProcessingParameterCrs,
QgsProcessingParameterFeatureSink)
@@ -145,11 +144,11 @@ def processAlgorithm(self, parameters, context, feedback):
break

if randomize:
geom = QgsGeometry().fromPointXY(QgsPointXY(
geom = QgsGeometry(QgsPoint(
uniform(x - (pSpacing / 2.0), x + (pSpacing / 2.0)),
uniform(y - (pSpacing / 2.0), y + (pSpacing / 2.0))))
else:
geom = QgsGeometry().fromPointXY(QgsPointXY(x, y))
geom = QgsGeometry(QgsPoint(x, y))

if extent_engine.intersects(geom.constGet()):
f.setAttributes([id])

0 comments on commit 0faa7ec

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