Skip to content
Permalink
Browse files

Fix python plugins

  • Loading branch information
m-kuhn committed Jun 2, 2017
1 parent 881dfef commit 4ba385d4e17a98604e7e1757cbff0aaca498922f
@@ -35,7 +35,7 @@
QgsField,
QgsFeature,
QgsGeometry,
QgsPoint,
QgsPointXY,
QgsLineString,
QgsWkbTypes,
QgsFields)
@@ -150,8 +150,8 @@ def processAlgorithm(self, context, feedback):
count_update = count_max * 0.10
y = bbox.yMaximum()
while y >= bbox.yMinimum():
pt1 = QgsPoint(bbox.xMinimum(), y)
pt2 = QgsPoint(bbox.xMaximum(), y)
pt1 = QgsPointXY(bbox.xMinimum(), y)
pt2 = QgsPointXY(bbox.xMaximum(), y)
line = QgsLineString()
line.setPoints([pt1, pt2])
feat.setGeometry(QgsGeometry(line))
@@ -177,8 +177,8 @@ def processAlgorithm(self, context, feedback):
count_update = count_max * 0.10
x = bbox.xMinimum()
while x <= bbox.xMaximum():
pt1 = QgsPoint(x, bbox.yMaximum())
pt2 = QgsPoint(x, bbox.yMinimum())
pt1 = QgsPointXY(x, bbox.yMaximum())
pt2 = QgsPointXY(x, bbox.yMinimum())
line = QgsLineString()
line.setPoints([pt1, pt2])
feat.setGeometry(QgsGeometry(line))
@@ -34,7 +34,7 @@
QgsFeature,
QgsGeometry,
QgsWkbTypes,
QgsPoint,
QgsPointXY,
QgsProcessingUtils)
from qgis.PyQt.QtCore import QVariant
from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -118,7 +118,7 @@ def processAlgorithm(self, context, feedback):
for row in range(startRow, endRow + 1):
for col in range(startColumn, endColumn + 1):
(x, y) = raster.pixelToMap(row, col, geoTransform)
point = QgsPoint()
point = QgsPointXY()
point.setX(x)
point.setY(y)

@@ -27,7 +27,7 @@

from qgis.core import (QgsApplication,
QgsWkbTypes,
QgsPoint,
QgsPointXY,
QgsCoordinateReferenceSystem,
QgsGeometry,
QgsProcessingUtils)
@@ -120,7 +120,7 @@ def processAlgorithm(self, context, feedback):
x = float(attrs[x_field_index])
y = float(attrs[y_field_index])

point = QgsPoint(x, y)
point = QgsPointXY(x, y)

if z_field_index is not None:
try:
@@ -35,7 +35,7 @@
QgsField,
QgsGeometry,
QgsSpatialIndex,
QgsPoint,
QgsPointXY,
NULL,
QgsProcessingUtils)

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

# find features for all available colors
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):
# feature with each assigned color
for other_feature_id, c in other_features.items():
other_geometry = features[other_feature_id].geometry()
other_centroid = QgsPoint(other_geometry.centroid().geometry())
other_centroid = QgsPointXY(other_geometry.centroid().geometry())

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

0 comments on commit 4ba385d

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