Skip to content

Commit 5e1d613

Browse files
committed
update Processing algorithms to use new enum values
1 parent 4a02921 commit 5e1d613

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -83,33 +83,33 @@ def initAlgorithm(self, config=None):
8383
[
8484
(
8585
self.tr("Quartic"),
86-
QgsKernelDensityEstimation.KernelShape.KernelQuartic,
86+
QgsKernelDensityEstimation.KernelShape.Quartic,
8787
),
8888
(
8989
self.tr("Triangular"),
90-
QgsKernelDensityEstimation.KernelShape.KernelTriangular,
90+
QgsKernelDensityEstimation.KernelShape.Triangular,
9191
),
9292
(
9393
self.tr("Uniform"),
94-
QgsKernelDensityEstimation.KernelShape.KernelUniform,
94+
QgsKernelDensityEstimation.KernelShape.Uniform,
9595
),
9696
(
9797
self.tr("Triweight"),
98-
QgsKernelDensityEstimation.KernelShape.KernelTriweight,
98+
QgsKernelDensityEstimation.KernelShape.Triweight,
9999
),
100100
(
101101
self.tr("Epanechnikov"),
102-
QgsKernelDensityEstimation.KernelShape.KernelEpanechnikov,
102+
QgsKernelDensityEstimation.KernelShape.Epanechnikov,
103103
),
104104
]
105105
)
106106

107107
self.OUTPUT_VALUES = OrderedDict(
108108
[
109-
(self.tr("Raw"), QgsKernelDensityEstimation.OutputValues.OutputRaw),
109+
(self.tr("Raw"), QgsKernelDensityEstimation.OutputValues.Raw),
110110
(
111111
self.tr("Scaled"),
112-
QgsKernelDensityEstimation.OutputValues.OutputScaled,
112+
QgsKernelDensityEstimation.OutputValues.Scaled,
113113
),
114114
]
115115
)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def processAlgorithm(self, parameters, context, feedback):
169169
data.valueSource = QgsInterpolator.ValueSource(int(v[1]))
170170
data.interpolationAttribute = int(v[2])
171171
if (
172-
data.valueSource == QgsInterpolator.ValueSource.ValueAttribute
172+
data.valueSource == QgsInterpolator.ValueSource.Attribute
173173
and data.interpolationAttribute == -1
174174
):
175175
raise QgsProcessingException(

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def processAlgorithm(self, parameters, context, feedback):
183183
data.valueSource = QgsInterpolator.ValueSource(int(v[1]))
184184
data.interpolationAttribute = int(v[2])
185185
if (
186-
data.valueSource == QgsInterpolator.ValueSource.ValueAttribute
186+
data.valueSource == QgsInterpolator.ValueSource.Attribute
187187
and data.interpolationAttribute == -1
188188
):
189189
raise QgsProcessingException(

python/plugins/processing/algs/qgis/ui/InterpolationWidgets.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ def value(self) -> str:
194194
continue
195195

196196
interpolationAttribute = item.text(1)
197-
interpolationSource = QgsInterpolator.ValueSource.ValueAttribute
197+
interpolationSource = QgsInterpolator.ValueSource.Attribute
198198
if interpolationAttribute == "Z_COORD":
199-
interpolationSource = QgsInterpolator.ValueSource.ValueZ
199+
interpolationSource = QgsInterpolator.ValueSource.Z
200200
fieldIndex = -1
201201
else:
202202
fieldIndex = layer.fields().indexFromName(interpolationAttribute)
@@ -206,11 +206,11 @@ def value(self) -> str:
206206
)
207207
inputTypeName = comboBox.currentText()
208208
if inputTypeName == self.tr("Points"):
209-
inputType = QgsInterpolator.SourceType.SourcePoints
209+
inputType = QgsInterpolator.SourceType.Points
210210
elif inputTypeName == self.tr("Structure lines"):
211-
inputType = QgsInterpolator.SourceType.SourceStructureLines
211+
inputType = QgsInterpolator.SourceType.StructureLines
212212
else:
213-
inputType = QgsInterpolator.SourceType.SourceBreakLines
213+
inputType = QgsInterpolator.SourceType.BreakLines
214214

215215
layers += "{}::~::{:d}::~::{:d}::~::{:d}::|::".format(
216216
layer.source(), interpolationSource, fieldIndex, inputType

0 commit comments

Comments
 (0)