Skip to content

Commit 923ab1b

Browse files
committedDec 16, 2012
don't break the loop after interior ring while calculating perimeter:
the returned ptr's pointing to a wrong position whether we break the loop before reading all the points of all the rings.
1 parent a2f4db6 commit 923ab1b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎src/core/qgsdistancearea.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,16 +543,15 @@ unsigned char* QgsDistanceArea::measurePolygon( unsigned char* feature, double*
543543

544544
if ( perimeter )
545545
{
546-
*perimeter += measureLine( points );
546+
if ( idx == 0 )
547+
{
548+
// exterior ring
549+
*perimeter += measureLine( points );
550+
}
547551
}
548552
}
549553

550554
points.clear();
551-
552-
if ( !area )
553-
{
554-
break;
555-
}
556555
}
557556
}
558557
catch ( QgsCsException &cse )

3 commit comments

Comments
 (3)

brushtyler commented on Dec 17, 2012

@brushtyler
ContributorAuthor

Doh! The commit message should look like "don't break the loop after exterior ring [...]".
Any way to change it after it was pushed?

NathanW2 commented on Dec 17, 2012

@NathanW2
Member

No way to change it once you push it. Well you can but it's not a good idea as other people would have got that change and you will change the commit id.

brushtyler commented on Dec 17, 2012

@brushtyler
ContributorAuthor

it's not a good idea as other people would have got that change and you will change the commit id.

... and Jenkins has already ended to process it about 32 min ago :)

Please sign in to comment.