1
0
mirror of https://github.com/qgis/QGIS.git synced 2025-04-28 00:05:04 -04:00

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
This commit is contained in:
Nyall Dawson 2017-09-20 18:20:17 +10:00
parent f268ccc837
commit 148a906cb5

@ -407,10 +407,18 @@ void QgsCompoundCurve::addCurve( QgsCurve *c )
{ {
c->addZValue(); c->addZValue();
} }
else if ( !QgsWkbTypes::hasZ( mWkbType ) && QgsWkbTypes::hasZ( c->wkbType() ) )
{
c->dropZValue();
}
if ( QgsWkbTypes::hasM( mWkbType ) && !QgsWkbTypes::hasM( c->wkbType() ) ) if ( QgsWkbTypes::hasM( mWkbType ) && !QgsWkbTypes::hasM( c->wkbType() ) )
{ {
c->addMValue(); c->addMValue();
} }
else if ( !QgsWkbTypes::hasM( mWkbType ) && QgsWkbTypes::hasM( c->wkbType() ) )
{
c->dropMValue();
}
clearCache(); clearCache();
} }
} }