[QGIS Commit] r15153 - trunk/qgis/python/plugins/fTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Feb 10 12:32:07 EST 2011


Author: cfarmer
Date: 2011-02-10 09:32:07 -0800 (Thu, 10 Feb 2011)
New Revision: 15153

Modified:
   trunk/qgis/python/plugins/fTools/tools/doPointDistance.py
Log:
fix bug where k+1 closest feature are measured in point distance tool

Modified: trunk/qgis/python/plugins/fTools/tools/doPointDistance.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doPointDistance.py	2011-02-10 17:30:43 UTC (rev 15152)
+++ trunk/qgis/python/plugins/fTools/tools/doPointDistance.py	2011-02-10 17:32:07 UTC (rev 15153)
@@ -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 @@
     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 @@
             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 @@
             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()



More information about the QGIS-commit mailing list