Skip to content
Permalink
Browse files

fix when 3D and M

  • Loading branch information
PeterPetrik committed Jan 28, 2016
1 parent 86e6771 commit 84e8b10d2d03cdf1e6b8d8d1c4c1a6169ec6dfc3
Showing with 29 additions and 16 deletions.
  1. +29 −16 src/core/geometry/qgslinestringv2.cpp
@@ -454,31 +454,44 @@ void QgsLineStringV2::append( const QgsLineStringV2* line )
{
mX.pop_back();
mY.pop_back();
mZ.pop_back();
mM.pop_back();

if ( is3D() )
{
mZ.pop_back();
}
if ( isMeasure() )
{
mM.pop_back();
}
}

mX += line->mX;
mY += line->mY;

if ( line->is3D() )
{
mZ += line->mZ;
}
else
if ( is3D() )
{
// 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() )
{
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 ( isMeasure() )
{
// 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 );
if ( line->isMeasure() )
{
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

0 comments on commit 84e8b10

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