Skip to content
Permalink
Browse files
[processing] fix Distance Matrix tool (fix #7618)
  • Loading branch information
alexbruy committed Mar 24, 2014
1 parent 6ab62fd commit 7f522f9
Showing 1 changed file with 3 additions and 4 deletions.
@@ -113,7 +113,6 @@ def linearMatrix(self, inLayer, inField, targetLayer, targetField,
index = vector.spatialindex(targetLayer)

inIdx = inLayer.fieldNameIndex(inField)
inLayer.select([inIdx])
outIdx = targetLayer.fieldNameIndex(inField)

outFeat = QgsFeature()
@@ -136,10 +135,10 @@ def linearMatrix(self, inLayer, inField, targetLayer, targetField,
outID = outFeat.attributes()[outIdx]
outGeom = outFeat.geometry()
dist = distArea.measureLine(inGeom.asPoint(),
outGeom.asPoint())
outGeom.asPoint())
if matType == 0:
self.writer.addRecord([unicode(inID), unicode(outID),
unicode(dist)])
unicode(dist)])
else:
distList.append(float(dist))

@@ -191,7 +190,7 @@ def regularMatrix(self, inLayer, inField, targetLayer, targetField,
outFeat = targetLayer.getFeatures(request).next()
outGeom = outFeat.geometry()
dist = distArea.measureLine(inGeom.asPoint(),
outGeom.asPoint())
outGeom.asPoint())
data.append(unicode(float(dist)))
self.writer.addRecord(data)

0 comments on commit 7f522f9

Please sign in to comment.