Skip to content

Commit e1c3b4d

Browse files
committed
Fix incorrect point types when segmentizing circular strings
1 parent df8584a commit e1c3b4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/geometry/qgscircularstringv2.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,12 @@ void QgsCircularStringV2::segmentize( const QgsPointV2& p1, const QgsPointV2& p2
512512
points.append( p1 );
513513
if ( p2 != p3 && p1 != p2 ) //draw straight line segment if two points have the same position
514514
{
515+
QgsWKBTypes::Type pointWkbType = QgsWKBTypes::Point;
516+
if ( hasZ )
517+
pointWkbType = QgsWKBTypes::addZ( pointWkbType );
518+
if ( hasM )
519+
pointWkbType = QgsWKBTypes::addM( pointWkbType );
520+
515521
for ( double angle = a1 + increment; clockwise ? angle > a3 : angle < a3; angle += increment )
516522
{
517523
x = centerX + radius * cos( angle );
@@ -532,7 +538,7 @@ void QgsCircularStringV2::segmentize( const QgsPointV2& p1, const QgsPointV2& p2
532538
m = interpolateArc( angle, a1, a2, a3, p1.m(), p2.m(), p3.m() );
533539
}
534540

535-
points.append( QgsPointV2( mWkbType, x, y, z, m ) );
541+
points.append( QgsPointV2( pointWkbType, x, y, z, m ) );
536542
}
537543
}
538544
points.append( p3 );

0 commit comments

Comments
 (0)