Skip to content

Commit 0faa7ec

Browse files
committed
[processing] Minor optimization for regular points algorithm
1 parent 9d6b5a7 commit 0faa7ec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

python/plugins/processing/algs/qgis/RegularPoints.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@
3838
QgsFeature,
3939
QgsWkbTypes,
4040
QgsGeometry,
41-
QgsPointXY,
41+
QgsPoint,
4242
QgsProcessing,
4343
QgsProcessingException,
4444
QgsProcessingParameterDistance,
4545
QgsProcessingParameterExtent,
46-
QgsProcessingParameterNumber,
4746
QgsProcessingParameterBoolean,
4847
QgsProcessingParameterCrs,
4948
QgsProcessingParameterFeatureSink)
@@ -145,11 +144,11 @@ def processAlgorithm(self, parameters, context, feedback):
145144
break
146145

147146
if randomize:
148-
geom = QgsGeometry().fromPointXY(QgsPointXY(
147+
geom = QgsGeometry(QgsPoint(
149148
uniform(x - (pSpacing / 2.0), x + (pSpacing / 2.0)),
150149
uniform(y - (pSpacing / 2.0), y + (pSpacing / 2.0))))
151150
else:
152-
geom = QgsGeometry().fromPointXY(QgsPointXY(x, y))
151+
geom = QgsGeometry(QgsPoint(x, y))
153152

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

0 commit comments

Comments
 (0)