Skip to content

Commit

Permalink
Change full circle interpretation, fixes #15116
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 27, 2016
1 parent 3b1d4e2 commit 203f975
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/geometry/qgscircularstringv2.cpp
Expand Up @@ -879,7 +879,7 @@ void QgsCircularStringV2::sumUpArea( double& sum ) const
//segment is a full circle, p2 is the center point
if ( p1 == p3 )
{
double r2 = QgsGeometryUtils::sqrDistance2D( p1, p2 );
double r2 = QgsGeometryUtils::sqrDistance2D( p1, p2 ) / 2.0;
sum += M_PI * r2;
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -359,9 +359,9 @@ void QgsGeometryUtils::circleCenterRadius( const QgsPointV2& pt1, const QgsPoint
//closed circle
if ( qgsDoubleNear( pt1.x(), pt3.x() ) && qgsDoubleNear( pt1.y(), pt3.y() ) )
{
centerX = pt2.x();
centerY = pt2.y();
radius = sqrt( pow( pt2.x() - pt1.x(), 2.0 ) + pow( pt2.y() - pt1.y(), 2.0 ) );
centerX = ( pt1.x() + pt2.x() ) / 2.0;
centerY = ( pt1.y() + pt2.y() ) / 2.0;
radius = sqrt( pow( centerX - pt1.x(), 2.0 ) + pow( centerY - pt1.y(), 2.0 ) );
return;
}

Expand Down

0 comments on commit 203f975

Please sign in to comment.