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 Feb 4, 2017
1 parent 449a4a8 commit 81befa3
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 @@ -371,7 +371,7 @@ double QgsCurvePolygonV2::area() const

double totalArea = 0.0;

if ( mExteriorRing->isClosed() )
if ( mExteriorRing->isRing() )
{
double area = 0.0;
mExteriorRing->sumUpArea( area );
Expand All @@ -382,7 +382,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 81befa3

Please sign in to comment.