Skip to content

Commit 01c8cf9

Browse files
author
cfarmer
committedFeb 10, 2011
fix bug where k+1 closest feature are measured in point distance tool
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15153 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎python/plugins/fTools/tools/doPointDistance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Copyright (C) 2008 Carson Farmer
1212
#
1313
# EMAIL: carson.farmer (at) gmail.com
14-
# WEB : www.geog.uvic.ca/spar/carson
14+
# WEB : www.carsonfarmer.com/
1515
#
1616
#-----------------------------------------------------------
1717
#
@@ -47,7 +47,7 @@ class UnicodeWriter:
4747
A CSV writer which will write rows to CSV file "f",
4848
which is encoded in the given encoding.
4949
Taken from http://docs.python.org/library/csv.html
50-
to allow handling of nonascii output
50+
to allow handling of non-ascii output
5151
"""
5252

5353
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
@@ -134,7 +134,7 @@ def accept(self):
134134
elif self.rdoStandard.isChecked(): matType = "Standard"
135135
else: matType = "Summary"
136136
if self.chkNearest.isChecked(): nearest = self.spnNearest.value()
137-
else: nearest = nearest = 0
137+
else: nearest = 0
138138
if outPath.contains("\\"):
139139
outName = outPath.right((outPath.length() - outPath.lastIndexOf("\\")) - 1)
140140
else:
@@ -173,7 +173,7 @@ def compute(self, line1, line2, field1, field2, outPath, matType, nearest, progr
173173
sindex.insertFeature(inFeat)
174174
provider2.rewind()
175175
if nearest < 1: nearest = layer2.featureCount()
176-
else: nearest = nearest + 1
176+
else: nearest = nearest
177177
index1 = provider1.fieldNameIndex(field1)
178178
index2 = provider2.fieldNameIndex(field2)
179179
sRs = provider1.crs()

0 commit comments

Comments
 (0)
Please sign in to comment.