Skip to content

Commit 148a906

Browse files
committedSep 21, 2017
Fix adding curves with Z/M to non Z/M compound curves
Z/M for these curves should be dropped to ensure consistent dimensionality for the whole compound curve
1 parent f268ccc commit 148a906

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/core/geometry/qgscompoundcurve.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,18 @@ void QgsCompoundCurve::addCurve( QgsCurve *c )
407407
{
408408
c->addZValue();
409409
}
410+
else if ( !QgsWkbTypes::hasZ( mWkbType ) && QgsWkbTypes::hasZ( c->wkbType() ) )
411+
{
412+
c->dropZValue();
413+
}
410414
if ( QgsWkbTypes::hasM( mWkbType ) && !QgsWkbTypes::hasM( c->wkbType() ) )
411415
{
412416
c->addMValue();
413417
}
418+
else if ( !QgsWkbTypes::hasM( mWkbType ) && QgsWkbTypes::hasM( c->wkbType() ) )
419+
{
420+
c->dropMValue();
421+
}
414422
clearCache();
415423
}
416424
}

0 commit comments

Comments
 (0)
Please sign in to comment.