Skip to content

Commit

Permalink
fix #2056
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12283 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 29, 2009
1 parent 7f3c435 commit b426569
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/plugins/fTools/tools/doGeometry.py
Expand Up @@ -456,6 +456,10 @@ def polygon_centroids( self ):
cx+=((line[i].x()-xmin)+(line[j].x()-xmin))*factor
cy+=((line[i].y()-ymin)+(line[j].y()-ymin))*factor
area+=factor

if area==0:
continue

cx/=area*3.00
cy/=area*3.00
outfeat.setGeometry( QgsGeometry.fromPoint( QgsPoint( cx+xmin, cy+ymin ) ) )
Expand Down

0 comments on commit b426569

Please sign in to comment.