Skip to content

Commit 73306f1

Browse files
committed
Update python code
1 parent fd7ffad commit 73306f1

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,18 @@ def processAlgorithm(self, parameters, context, feedback):
155155
data = QgsInterpolator.LayerData()
156156

157157
# need to keep a reference until interpolation is complete
158-
layer = QgsProcessingUtils.mapLayerFromString(v[0], context)
159-
data.vectorLayer = layer
158+
layer = QgsProcessingUtils.variantToSource(v[0], context)
159+
data.source = layer
160160
layers.append(layer)
161161

162-
data.zCoordInterpolation = bool(v[1])
162+
data.useZValue = bool(v[1])
163163
data.interpolationAttribute = int(v[2])
164164
if v[3] == '0':
165-
data.mInputType = QgsInterpolator.POINTS
165+
data.sourceType = QgsInterpolator.SourcePoints
166166
elif v[3] == '1':
167-
data.mInputType = QgsInterpolator.STRUCTURE_LINES
167+
data.sourceType = QgsInterpolator.SourceStructureLines
168168
else:
169-
data.mInputType = QgsInterpolator.BREAK_LINES
169+
data.sourceType = QgsInterpolator.SourceBreakLines
170170
layerData.append(data)
171171

172172
interpolator = QgsIDWInterpolator(layerData)

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,20 @@ def processAlgorithm(self, parameters, context, feedback):
175175
data = QgsInterpolator.LayerData()
176176

177177
# need to keep a reference until interpolation is complete
178-
layer = QgsProcessingUtils.mapLayerFromString(v[0], context)
179-
data.vectorLayer = layer
178+
layer = QgsProcessingUtils.variantToSource(v[0], context)
179+
data.source = layer
180180
layers.append(layer)
181181
if not crs.isValid():
182-
crs = layer.crs()
182+
crs = layer.sourceCrs()
183183

184-
data.zCoordInterpolation = bool(v[1])
184+
data.useZValue = bool(v[1])
185185
data.interpolationAttribute = int(v[2])
186186
if v[3] == '0':
187-
data.mInputType = QgsInterpolator.POINTS
187+
data.sourceType = QgsInterpolator.SourcePoints
188188
elif v[3] == '1':
189-
data.mInputType = QgsInterpolator.STRUCTURE_LINES
189+
data.sourceType = QgsInterpolator.SourceStructureLines
190190
else:
191-
data.mInputType = QgsInterpolator.BREAK_LINES
191+
data.sourceType = QgsInterpolator.SourceBreakLines
192192
layerData.append(data)
193193

194194
if method == 0:

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ def value(self):
146146
comboBox = self.layersTree.itemWidget(self.layersTree.topLevelItem(i), 2)
147147
inputTypeName = comboBox.currentText()
148148
if inputTypeName == self.tr('Points'):
149-
inputType = QgsInterpolator.POINTS
149+
inputType = QgsInterpolator.SourcePoints
150150
elif inputTypeName == self.tr('Structure lines'):
151-
inputType = QgsInterpolator.STRUCTURE_LINES
151+
inputType = QgsInterpolator.SourceStructureLines
152152
else:
153-
inputType = QgsInterpolator.BREAK_LINES
153+
inputType = QgsInterpolator.SourceBreakLines
154154

155155
layers += '{},{},{:d},{:d};'.format(layer.source(),
156156
zCoord,

0 commit comments

Comments
 (0)