Skip to content

Commit

Permalink
Fix geometry length and area calculation (fix #12827)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 1, 2015
1 parent 5462e40 commit e295c1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/geometry/qgsgeos.cpp
Expand Up @@ -270,7 +270,8 @@ double QgsGeos::area() const

try
{
area = GEOSArea_r( geosinit.ctxt, mGeos, &area );
if ( GEOSArea_r( geosinit.ctxt, mGeos, &area ) != 1 )
return -1.0;
}
CATCH_GEOS( -1.0 );
return area;
Expand All @@ -285,7 +286,8 @@ double QgsGeos::length() const
}
try
{
length = GEOSLength_r( geosinit.ctxt, mGeos, &length );
if ( GEOSLength_r( geosinit.ctxt, mGeos, &length ) != 1 )
return -1.0;
}
CATCH_GEOS( -1.0 )
return length;
Expand Down

0 comments on commit e295c1f

Please sign in to comment.