Skip to content
Permalink
Browse files

Fix incorrect point types when segmentizing circular strings

(cherry-picked from e1c3b4)
  • Loading branch information
nyalldawson committed Nov 25, 2015
1 parent 066867b commit 0680b1350b52893c7d8823a9a6b1490941053433
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/core/geometry/qgscircularstringv2.cpp
@@ -512,6 +512,12 @@ void QgsCircularStringV2::segmentize( const QgsPointV2& p1, const QgsPointV2& p2
points.append( p1 );
if ( p2 != p3 && p1 != p2 ) //draw straight line segment if two points have the same position
{
QgsWKBTypes::Type pointWkbType = QgsWKBTypes::Point;
if ( hasZ )
pointWkbType = QgsWKBTypes::addZ( pointWkbType );
if ( hasM )
pointWkbType = QgsWKBTypes::addM( pointWkbType );

for ( double angle = a1 + increment; clockwise ? angle > a3 : angle < a3; angle += increment )
{
x = centerX + radius * cos( angle );
@@ -532,7 +538,7 @@ void QgsCircularStringV2::segmentize( const QgsPointV2& p1, const QgsPointV2& p2
m = interpolateArc( angle, a1, a2, a3, p1.m(), p2.m(), p3.m() );
}

points.append( QgsPointV2( mWkbType, x, y, z, m ) );
points.append( QgsPointV2( pointWkbType, x, y, z, m ) );
}
}
points.append( p3 );

0 comments on commit 0680b13

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