Skip to content

Commit

Permalink
Exclude degenerated rings from polygon area calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 5, 2017
1 parent 1c02dc7 commit 64b0b10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/geometry/qgscurvepolygonv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ double QgsCurvePolygonV2::area() const

double totalArea = 0.0;

if ( mExteriorRing->isClosed() )
if ( mExteriorRing->isRing() )
{
double area = 0.0;
mExteriorRing->sumUpArea( area );
Expand All @@ -376,7 +376,7 @@ double QgsCurvePolygonV2::area() const
for ( ; ringIt != mInteriorRings.constEnd(); ++ringIt )
{
double area = 0.0;
if (( *ringIt )->isClosed() )
if (( *ringIt )->isRing() )
{
( *ringIt )->sumUpArea( area );
totalArea -= qAbs( area );
Expand Down

0 comments on commit 64b0b10

Please sign in to comment.