Skip to content

Commit

Permalink
fix bug where k+1 closest feature are measured in point distance tool
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15153 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Feb 10, 2011
1 parent 01893af commit 9f1a59f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/plugins/fTools/tools/doPointDistance.py
Expand Up @@ -11,7 +11,7 @@
# Copyright (C) 2008 Carson Farmer
#
# EMAIL: carson.farmer (at) gmail.com
# WEB : www.geog.uvic.ca/spar/carson
# WEB : www.carsonfarmer.com/
#
#-----------------------------------------------------------
#
Expand Down Expand Up @@ -47,7 +47,7 @@ class UnicodeWriter:
A CSV writer which will write rows to CSV file "f",
which is encoded in the given encoding.
Taken from http://docs.python.org/library/csv.html
to allow handling of nonascii output
to allow handling of non-ascii output
"""

def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
Expand Down Expand Up @@ -134,7 +134,7 @@ def accept(self):
elif self.rdoStandard.isChecked(): matType = "Standard"
else: matType = "Summary"
if self.chkNearest.isChecked(): nearest = self.spnNearest.value()
else: nearest = nearest = 0
else: nearest = 0
if outPath.contains("\\"):
outName = outPath.right((outPath.length() - outPath.lastIndexOf("\\")) - 1)
else:
Expand Down Expand Up @@ -173,7 +173,7 @@ def compute(self, line1, line2, field1, field2, outPath, matType, nearest, progr
sindex.insertFeature(inFeat)
provider2.rewind()
if nearest < 1: nearest = layer2.featureCount()
else: nearest = nearest + 1
else: nearest = nearest
index1 = provider1.fieldNameIndex(field1)
index2 = provider2.fieldNameIndex(field2)
sRs = provider1.crs()
Expand Down

0 comments on commit 9f1a59f

Please sign in to comment.