Skip to content
Permalink
Browse files

Change full circle interpretation, fixes #15116

  • Loading branch information
mhugent committed Jun 27, 2016
1 parent 3b1d4e2 commit 203f9755eed37206b5721a9294542603815a305d
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/core/geometry/qgscircularstringv2.cpp
  2. +3 −3 src/core/geometry/qgsgeometryutils.cpp
@@ -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;
}
@@ -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;
}

0 comments on commit 203f975

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