Skip to content

Commit

Permalink
Fix incorrect point types when segmentizing circular strings
Browse files Browse the repository at this point in the history
(cherry-picked from e1c3b4)
  • Loading branch information
nyalldawson committed Nov 25, 2015
1 parent 066867b commit 0680b13
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/geometry/qgscircularstringv2.cpp
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down

0 comments on commit 0680b13

Please sign in to comment.