Skip to content

Commit 3ae09a7

Browse files
author
cfarmer
committed
fixes output attributes for delaunay triangulation function
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10513 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent af6275c commit 3ae09a7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

python/plugins/fTools/tools/doGeometry.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,10 @@ def delaunay_triangulation( self ):
480480
fields, QGis.WKBPolygon, vprovider.crs() )
481481
inFeat = QgsFeature()
482482
points = []
483-
print "here"
484483
while vprovider.nextFeature( inFeat ):
485484
inGeom = QgsGeometry( inFeat.geometry() )
486485
point = inGeom.asPoint()
487486
points.append( point )
488-
print "or here"
489487
vprovider.rewind()
490488
vprovider.select( allAttrs )
491489
triangles = voronoi.computeDelaunayTriangulation( points )
@@ -500,11 +498,11 @@ def delaunay_triangulation( self ):
500498
polygon = []
501499
step = 0
502500
for index in indicies:
503-
vprovider.featureAtId( index, feat, True, allAttrs )
504-
geom = QgsGeometry( feat.geometry() )
501+
vprovider.featureAtId( index, inFeat, True, allAttrs )
502+
geom = QgsGeometry( inFeat.geometry() )
505503
point = QgsPoint( geom.asPoint() )
506504
polygon.append( point )
507-
feat.addAttribute( step, QVariant( index ) )
505+
if step <= 3: feat.addAttribute( step, QVariant( index ) )
508506
step += 1
509507
geometry = QgsGeometry().fromPolygon( [ polygon ] )
510508
feat.setGeometry( geometry )

0 commit comments

Comments
 (0)