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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Apr 8 20:47:55 EDT 2009


Author: cfarmer
Date: 2009-04-08 20:47:55 -0400 (Wed, 08 Apr 2009)
New Revision: 10513

Modified:
   trunk/qgis/python/plugins/fTools/tools/doGeometry.py
Log:
fixes output attributes for delaunay triangulation function


Modified: trunk/qgis/python/plugins/fTools/tools/doGeometry.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doGeometry.py	2009-04-09 00:19:51 UTC (rev 10512)
+++ trunk/qgis/python/plugins/fTools/tools/doGeometry.py	2009-04-09 00:47:55 UTC (rev 10513)
@@ -480,12 +480,10 @@
     fields, QGis.WKBPolygon, vprovider.crs() )
     inFeat = QgsFeature()
     points = []
-    print "here"
     while vprovider.nextFeature( inFeat ):
       inGeom = QgsGeometry( inFeat.geometry() )
       point = inGeom.asPoint()
       points.append( point )
-    print "or here"
     vprovider.rewind()
     vprovider.select( allAttrs )
     triangles = voronoi.computeDelaunayTriangulation( points )
@@ -500,11 +498,11 @@
       polygon = []
       step = 0
       for index in indicies:
-        vprovider.featureAtId( index, feat, True,  allAttrs )
-        geom = QgsGeometry( feat.geometry() )
+        vprovider.featureAtId( index, inFeat, True,  allAttrs )
+        geom = QgsGeometry( inFeat.geometry() )
         point = QgsPoint( geom.asPoint() )
         polygon.append( point )
-        feat.addAttribute( step, QVariant( index ) )
+        if step <= 3: feat.addAttribute( step, QVariant( index ) )
         step += 1
       geometry = QgsGeometry().fromPolygon( [ polygon ] )
       feat.setGeometry( geometry )      



More information about the QGIS-commit mailing list