Skip to content
Permalink
Browse files

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
  • Loading branch information
cfarmer
cfarmer committed Feb 10, 2011
1 parent f4b741d commit 01c8cf986da5aaae8c0fadf594122d212cb289e9
Showing with 4 additions and 4 deletions.
  1. +4 −4 python/plugins/fTools/tools/doPointDistance.py
@@ -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/
#
#-----------------------------------------------------------
#
@@ -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):
@@ -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:
@@ -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()

0 comments on commit 01c8cf9

Please sign in to comment.
You can’t perform that action at this time.