Skip to content
Permalink
Browse files
fixes output attributes for delaunay triangulation function
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10513 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Apr 9, 2009
1 parent af6275c commit 3ae09a7dab57304199a91e1a3f8267ff16640cf3
Showing with 3 additions and 5 deletions.
  1. +3 −5 python/plugins/fTools/tools/doGeometry.py
@@ -480,12 +480,10 @@ def delaunay_triangulation( self ):
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 @@ def delaunay_triangulation( self ):
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 )

0 comments on commit 3ae09a7

Please sign in to comment.