Skip to content

Commit

Permalink
Fix adding curves with Z/M to non Z/M compound curves
Browse files Browse the repository at this point in the history
Z/M for these curves should be dropped to ensure consistent
dimensionality for the whole compound curve
  • Loading branch information
nyalldawson committed Sep 21, 2017
1 parent f268ccc commit 148a906
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/geometry/qgscompoundcurve.cpp
Expand Up @@ -407,10 +407,18 @@ void QgsCompoundCurve::addCurve( QgsCurve *c )
{
c->addZValue();
}
else if ( !QgsWkbTypes::hasZ( mWkbType ) && QgsWkbTypes::hasZ( c->wkbType() ) )
{
c->dropZValue();
}
if ( QgsWkbTypes::hasM( mWkbType ) && !QgsWkbTypes::hasM( c->wkbType() ) )
{
c->addMValue();
}
else if ( !QgsWkbTypes::hasM( mWkbType ) && QgsWkbTypes::hasM( c->wkbType() ) )
{
c->dropMValue();
}
clearCache();
}
}
Expand Down

0 comments on commit 148a906

Please sign in to comment.