Skip to content
Permalink
Browse files

Exclude degenerated rings from polygon area calculation

(forward port from 64b0b1)
  • Loading branch information
mhugent authored and nyalldawson committed Feb 4, 2017
1 parent 449a4a8 commit 81befa3898031eeec917c0481ff0fcf008e50987
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/geometry/qgscurvepolygonv2.cpp
@@ -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 );
@@ -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 );

0 comments on commit 81befa3

Please sign in to comment.
You can’t perform that action at this time.