Skip to content

Commit dabd15e

Browse files
lbartolettinyalldawson
authored andcommittedJun 9, 2021
replace convertTo/set by add{M,Z}Value
1 parent 1d0e482 commit dabd15e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed
 

‎src/core/geometry/qgsgeometryutils.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,14 +1815,12 @@ bool QgsGeometryUtils::transferFirstZOrMValueToPoint( const QgsPointSequence &po
18151815
{
18161816
if ( !m_passed && pt.isMeasure() )
18171817
{
1818-
point.convertTo( QgsWkbTypes::addM( point.wkbType() ) );
1819-
point.setM( pt.m() );
1818+
point.addMValue( pt.m() );
18201819
mFound = true;
18211820
}
18221821
if ( !z_passed && pt.is3D() )
18231822
{
1824-
point.convertTo( QgsWkbTypes::addZ( point.wkbType() ) );
1825-
point.setZ( pt.z() );
1823+
point.addZValue( pt.z() );
18261824
zFound = true;
18271825
}
18281826
if ( zFound && mFound )
@@ -1840,8 +1838,7 @@ bool QgsGeometryUtils::transferFirstMValueToPoint( const QgsPointSequence &point
18401838
{
18411839
if ( pt.isMeasure() )
18421840
{
1843-
point.convertTo( QgsWkbTypes::addM( point.wkbType() ) );
1844-
point.setM( pt.m() );
1841+
point.addMValue( pt.m() );
18451842
rc = true;
18461843
break;
18471844
}
@@ -1858,8 +1855,7 @@ bool QgsGeometryUtils::transferFirstZValueToPoint( const QgsPointSequence &point
18581855
{
18591856
if ( pt.is3D() )
18601857
{
1861-
point.convertTo( QgsWkbTypes::addZ( point.wkbType() ) );
1862-
point.setZ( pt.z() );
1858+
point.addZValue( pt.z() );
18631859
rc = true;
18641860
break;
18651861
}

0 commit comments

Comments
 (0)
Please sign in to comment.