@@ -154,7 +154,7 @@ def linearMatrix(self, parameters, context, source, inField, target_source, targ
154
154
(sink , dest_id ) = self .parameterAsSink (parameters , self .OUTPUT , context ,
155
155
fields , out_wkb , source .sourceCrs ())
156
156
157
- index = QgsSpatialIndex (target_source .getFeatures (QgsFeatureRequest ().setSubsetOfAttributes ([]).setDestinationCrs (source .sourceCrs ())), feedback )
157
+ index = QgsSpatialIndex (target_source .getFeatures (QgsFeatureRequest ().setSubsetOfAttributes ([]).setDestinationCrs (source .sourceCrs (), context . transformContext () )), feedback )
158
158
159
159
distArea = QgsDistanceArea ()
160
160
distArea .setSourceCrs (source .sourceCrs ())
@@ -171,7 +171,7 @@ def linearMatrix(self, parameters, context, source, inField, target_source, targ
171
171
featList = index .nearestNeighbor (inGeom .asPoint (), nPoints )
172
172
distList = []
173
173
vari = 0.0
174
- request = QgsFeatureRequest ().setFilterFids (featList ).setSubsetOfAttributes ([outIdx ]).setDestinationCrs (source .sourceCrs ())
174
+ request = QgsFeatureRequest ().setFilterFids (featList ).setSubsetOfAttributes ([outIdx ]).setDestinationCrs (source .sourceCrs (), context . transformContext () )
175
175
for outFeat in target_source .getFeatures (request ):
176
176
if feedback .isCanceled ():
177
177
break
@@ -214,7 +214,7 @@ def regularMatrix(self, parameters, context, source, inField, target_source, tar
214
214
inIdx = source .fields ().lookupField (inField )
215
215
targetIdx = target_source .fields ().lookupField (targetField )
216
216
217
- index = QgsSpatialIndex (target_source .getFeatures (QgsFeatureRequest ().setSubsetOfAttributes ([]).setDestinationCrs (source .sourceCrs ())), feedback )
217
+ index = QgsSpatialIndex (target_source .getFeatures (QgsFeatureRequest ().setSubsetOfAttributes ([]).setDestinationCrs (source .sourceCrs (), context . transformContext () )), feedback )
218
218
219
219
first = True
220
220
sink = None
@@ -233,14 +233,14 @@ def regularMatrix(self, parameters, context, source, inField, target_source, tar
233
233
input_id_field = source .fields ()[inIdx ]
234
234
input_id_field .setName ('ID' )
235
235
fields .append (input_id_field )
236
- for f in target_source .getFeatures (QgsFeatureRequest ().setFilterFids (featList ).setSubsetOfAttributes ([targetIdx ]).setDestinationCrs (source .sourceCrs ())):
236
+ for f in target_source .getFeatures (QgsFeatureRequest ().setFilterFids (featList ).setSubsetOfAttributes ([targetIdx ]).setDestinationCrs (source .sourceCrs (), context . transformContext () )):
237
237
fields .append (QgsField (str (f [targetField ]), QVariant .Double ))
238
238
239
239
(sink , dest_id ) = self .parameterAsSink (parameters , self .OUTPUT , context ,
240
240
fields , source .wkbType (), source .sourceCrs ())
241
241
242
242
data = [inFeat [inField ]]
243
- for target in target_source .getFeatures (QgsFeatureRequest ().setSubsetOfAttributes ([]).setFilterFids (featList ).setDestinationCrs (source .sourceCrs ())):
243
+ for target in target_source .getFeatures (QgsFeatureRequest ().setSubsetOfAttributes ([]).setFilterFids (featList ).setDestinationCrs (source .sourceCrs (), context . transformContext () )):
244
244
if feedback .isCanceled ():
245
245
break
246
246
outGeom = target .geometry ()
0 commit comments