Skip to content

Commit

Permalink
fixes output attributes for delaunay triangulation function
Browse files Browse the repository at this point in the history
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 3ae09a7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions python/plugins/fTools/tools/doGeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down

0 comments on commit 3ae09a7

Please sign in to comment.