Skip to content

Commit

Permalink
Exclude degenerated rings from polygon area calculation
Browse files Browse the repository at this point in the history
(forward-port from 64b0b1)
  • Loading branch information
mhugent authored and nyalldawson committed Jan 9, 2017
1 parent 17b51ab commit e433639
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/geometry/qgscurvepolygon.cpp
Expand Up @@ -359,7 +359,7 @@ double QgsCurvePolygon::area() const

double totalArea = 0.0;

if ( mExteriorRing->isClosed() )
if ( mExteriorRing->isRing() )
{
double area = 0.0;
mExteriorRing->sumUpArea( area );
Expand All @@ -370,7 +370,7 @@ double QgsCurvePolygon::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 e433639

Please sign in to comment.