Skip to content

Commit 2398105

Browse files
committed
fix distance matrix k and k-1 issue
1 parent 343696a commit 2398105

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/plugins/fTools/tools/doPointDistance.py

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ def saveFile(self):
149149
def compute(self, line1, line2, field1, field2, outPath, matType, nearest, progressBar):
150150
layer1 = ftools_utils.getVectorLayerByName(line1)
151151
layer2 = ftools_utils.getVectorLayerByName(line2)
152+
if layer1.id() == layer2.id():
153+
if nearest > 0:
154+
nearest = nearest + 1
152155
provider1 = layer1.dataProvider()
153156
provider2 = layer2.dataProvider()
154157
sindex = QgsSpatialIndex()

0 commit comments

Comments
 (0)