mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] Minor optimization for regular points algorithm
This commit is contained in:
parent
9d6b5a7f53
commit
0faa7ecdae
@ -38,12 +38,11 @@ from qgis.core import (QgsApplication,
|
||||
QgsFeature,
|
||||
QgsWkbTypes,
|
||||
QgsGeometry,
|
||||
QgsPointXY,
|
||||
QgsPoint,
|
||||
QgsProcessing,
|
||||
QgsProcessingException,
|
||||
QgsProcessingParameterDistance,
|
||||
QgsProcessingParameterExtent,
|
||||
QgsProcessingParameterNumber,
|
||||
QgsProcessingParameterBoolean,
|
||||
QgsProcessingParameterCrs,
|
||||
QgsProcessingParameterFeatureSink)
|
||||
@ -145,11 +144,11 @@ class RegularPoints(QgisAlgorithm):
|
||||
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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user