Skip to content

Commit

Permalink
[processing] fix Distance Matrix tool (fix #7618)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 24, 2014
1 parent 6ab62fd commit 7f522f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/plugins/processing/algs/ftools/PointDistance.py
Expand Up @@ -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()
Expand All @@ -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))

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7f522f9

Please sign in to comment.