Skip to content

Commit

Permalink
use default Z/M values in QgsGeometry::coerceToType
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 4, 2022
1 parent af0d059 commit 65aaad2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/geometry/qgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ email : morb at ozemail dot com dot au
#include "qgsgeometry.h"
#include "qgsgeometryeditutils.h"
#include "qgsgeometryfactory.h"
#include "qgssettingsregistrycore.h"

#include <geos_c.h>

Expand Down Expand Up @@ -1537,11 +1538,11 @@ QVector<QgsGeometry> QgsGeometry::coerceToType( const QgsWkbTypes::Type type ) c
// Add Z/M back, set to 0
if ( ! newGeom.constGet()->is3D() && QgsWkbTypes::hasZ( type ) )
{
newGeom.get()->addZValue( 0.0 );
newGeom.get()->addZValue( QgsSettingsRegistryCore::settingsDigitizingDefaultZValue.value() );
}
if ( ! newGeom.constGet()->isMeasure() && QgsWkbTypes::hasM( type ) )
{
newGeom.get()->addMValue( 0.0 );
newGeom.get()->addMValue( QgsSettingsRegistryCore::settingsDigitizingDefaultMValue.value() );
}

// Multi -> single
Expand Down

0 comments on commit 65aaad2

Please sign in to comment.