Skip to content

Commit

Permalink
[processing] Minor optimization for regular points algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 15, 2018
1 parent 9d6b5a7 commit 0faa7ec
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/plugins/processing/algs/qgis/RegularPoints.py
Expand Up @@ -38,12 +38,11 @@
QgsFeature,
QgsWkbTypes,
QgsGeometry,
QgsPointXY,
QgsPoint,
QgsProcessing,
QgsProcessingException,
QgsProcessingParameterDistance,
QgsProcessingParameterExtent,
QgsProcessingParameterNumber,
QgsProcessingParameterBoolean,
QgsProcessingParameterCrs,
QgsProcessingParameterFeatureSink)
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 0faa7ec

Please sign in to comment.