Skip to content

Commit 4ba385d

Browse files
committed
Fix python plugins
1 parent 881dfef commit 4ba385d

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
QgsField,
3636
QgsFeature,
3737
QgsGeometry,
38-
QgsPoint,
38+
QgsPointXY,
3939
QgsLineString,
4040
QgsWkbTypes,
4141
QgsFields)
@@ -150,8 +150,8 @@ def processAlgorithm(self, context, feedback):
150150
count_update = count_max * 0.10
151151
y = bbox.yMaximum()
152152
while y >= bbox.yMinimum():
153-
pt1 = QgsPoint(bbox.xMinimum(), y)
154-
pt2 = QgsPoint(bbox.xMaximum(), y)
153+
pt1 = QgsPointXY(bbox.xMinimum(), y)
154+
pt2 = QgsPointXY(bbox.xMaximum(), y)
155155
line = QgsLineString()
156156
line.setPoints([pt1, pt2])
157157
feat.setGeometry(QgsGeometry(line))
@@ -177,8 +177,8 @@ def processAlgorithm(self, context, feedback):
177177
count_update = count_max * 0.10
178178
x = bbox.xMinimum()
179179
while x <= bbox.xMaximum():
180-
pt1 = QgsPoint(x, bbox.yMaximum())
181-
pt2 = QgsPoint(x, bbox.yMinimum())
180+
pt1 = QgsPointXY(x, bbox.yMaximum())
181+
pt2 = QgsPointXY(x, bbox.yMinimum())
182182
line = QgsLineString()
183183
line.setPoints([pt1, pt2])
184184
feat.setGeometry(QgsGeometry(line))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
QgsFeature,
3535
QgsGeometry,
3636
QgsWkbTypes,
37-
QgsPoint,
37+
QgsPointXY,
3838
QgsProcessingUtils)
3939
from qgis.PyQt.QtCore import QVariant
4040
from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -118,7 +118,7 @@ def processAlgorithm(self, context, feedback):
118118
for row in range(startRow, endRow + 1):
119119
for col in range(startColumn, endColumn + 1):
120120
(x, y) = raster.pixelToMap(row, col, geoTransform)
121-
point = QgsPoint()
121+
point = QgsPointXY()
122122
point.setX(x)
123123
point.setY(y)
124124

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
from qgis.core import (QgsApplication,
2929
QgsWkbTypes,
30-
QgsPoint,
30+
QgsPointXY,
3131
QgsCoordinateReferenceSystem,
3232
QgsGeometry,
3333
QgsProcessingUtils)
@@ -120,7 +120,7 @@ def processAlgorithm(self, context, feedback):
120120
x = float(attrs[x_field_index])
121121
y = float(attrs[y_field_index])
122122

123-
point = QgsPoint(x, y)
123+
point = QgsPointXY(x, y)
124124

125125
if z_field_index is not None:
126126
try:

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
QgsField,
3636
QgsGeometry,
3737
QgsSpatialIndex,
38-
QgsPoint,
38+
QgsPointXY,
3939
NULL,
4040
QgsProcessingUtils)
4141

@@ -234,7 +234,7 @@ def balanced(features, graph, feedback, balance=0, min_colors=4):
234234
color_areas[feature_color] += features[feature_id].geometry().area()
235235
elif balance == 2:
236236
min_distances = {c: sys.float_info.max for c in available_colors}
237-
this_feature_centroid = QgsPoint(features[feature_id].geometry().centroid().geometry())
237+
this_feature_centroid = QgsPointXY(features[feature_id].geometry().centroid().geometry())
238238

239239
# find features for all available colors
240240
other_features = {f_id: c for (f_id, c) in feature_colors.items() if c in available_colors}
@@ -243,7 +243,7 @@ def balanced(features, graph, feedback, balance=0, min_colors=4):
243243
# feature with each assigned color
244244
for other_feature_id, c in other_features.items():
245245
other_geometry = features[other_feature_id].geometry()
246-
other_centroid = QgsPoint(other_geometry.centroid().geometry())
246+
other_centroid = QgsPointXY(other_geometry.centroid().geometry())
247247

248248
distance = this_feature_centroid.distanceSquared(other_centroid)
249249
if distance < min_distances[c]:

0 commit comments

Comments
 (0)