Skip to content
Permalink
Browse files

Fix crash in QgsLineStringV2::append if non z/m line appended

to a LineString with z/m

(cherry-picked from ff3657)
  • Loading branch information
nyalldawson committed Nov 25, 2015
1 parent d7bd98a commit b8706eae4cf12e9559374cba9c995d693ab0f16b
Showing with 22 additions and 2 deletions.
  1. +22 −2 src/core/geometry/qgslinestringv2.cpp
@@ -300,8 +300,28 @@ void QgsLineStringV2::append( const QgsLineStringV2* line )
}

mCoords += line->mCoords;
mZ += line->mZ;
mM += line->mM;

if ( line->is3D() )
{
mZ += line->mZ;
}
else
{
// if append line does not have z coordinates, fill with 0 to match number of points in final line
mZ.insert( mZ.count(), mX.size() - mZ.size(), 0 );
}

if ( line->is3D() )
{
mM += line->mM;
}
else
{
// if append line does not have m values, fill with 0 to match number of points in final line
mM.insert( mM.count(), mX.size() - mM.size(), 0 );
}

mBoundingBox = QgsRectangle(); //set bounding box invalid
}

void QgsLineStringV2::draw( QPainter& p ) const

0 comments on commit b8706ea

Please sign in to comment.
You can’t perform that action at this time.