Skip to content

Commit 757e734

Browse files
author
jef
committedNov 29, 2009

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎python/plugins/fTools/tools/doGeometry.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ def polygon_centroids( self ):
456456
cx+=((line[i].x()-xmin)+(line[j].x()-xmin))*factor
457457
cy+=((line[i].y()-ymin)+(line[j].y()-ymin))*factor
458458
area+=factor
459+
460+
if area==0:
461+
continue
462+
459463
cx/=area*3.00
460464
cy/=area*3.00
461465
outfeat.setGeometry( QgsGeometry.fromPoint( QgsPoint( cx+xmin, cy+ymin ) ) )

0 commit comments

Comments
 (0)
Please sign in to comment.