@@ -449,7 +449,7 @@ bool QgsGeometry::deleteVertex( int atVertex )
449
449
}
450
450
451
451
// maintain compatibility with < 2.10 API
452
- if ( d->geometry ->geometryType () == " MultiPoint" )
452
+ if ( QgsWKBTypes::flatType ( d->geometry ->wkbType () ) == QgsWKBTypes:: MultiPoint )
453
453
{
454
454
detach ( true );
455
455
removeWkbGeos ();
@@ -487,7 +487,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
487
487
}
488
488
489
489
// maintain compatibility with < 2.10 API
490
- if ( d->geometry ->geometryType () == " MultiPoint" )
490
+ if ( QgsWKBTypes::flatType ( d->geometry ->wkbType () ) == QgsWKBTypes:: MultiPoint )
491
491
{
492
492
detach ( true );
493
493
removeWkbGeos ();
@@ -1008,7 +1008,7 @@ bool QgsGeometry::convertToSingleType()
1008
1008
1009
1009
QgsPoint QgsGeometry::asPoint () const
1010
1010
{
1011
- if ( !d->geometry || d->geometry ->geometryType () != " Point" )
1011
+ if ( !d->geometry || QgsWKBTypes::flatType ( d->geometry ->wkbType () ) != QgsWKBTypes:: Point )
1012
1012
{
1013
1013
return QgsPoint ();
1014
1014
}
@@ -1029,7 +1029,8 @@ QgsPolyline QgsGeometry::asPolyline() const
1029
1029
return polyLine;
1030
1030
}
1031
1031
1032
- bool doSegmentation = ( d->geometry ->geometryType () == " CompoundCurve" || d->geometry ->geometryType () == " CircularString" );
1032
+ bool doSegmentation = ( QgsWKBTypes::flatType ( d->geometry ->wkbType () ) == QgsWKBTypes::CompoundCurve
1033
+ || QgsWKBTypes::flatType ( d->geometry ->wkbType () ) == QgsWKBTypes::CircularString );
1033
1034
QgsLineStringV2* line = nullptr ;
1034
1035
if ( doSegmentation )
1035
1036
{
@@ -1071,7 +1072,7 @@ QgsPolygon QgsGeometry::asPolygon() const
1071
1072
if ( !d->geometry )
1072
1073
return QgsPolygon ();
1073
1074
1074
- bool doSegmentation = ( d->geometry ->geometryType () == " CurvePolygon" );
1075
+ bool doSegmentation = ( QgsWKBTypes::flatType ( d->geometry ->wkbType () ) == QgsWKBTypes:: CurvePolygon );
1075
1076
1076
1077
QgsPolygonV2* p = nullptr ;
1077
1078
if ( doSegmentation )
@@ -1105,7 +1106,7 @@ QgsPolygon QgsGeometry::asPolygon() const
1105
1106
1106
1107
QgsMultiPoint QgsGeometry::asMultiPoint () const
1107
1108
{
1108
- if ( !d->geometry || d->geometry ->geometryType () != " MultiPoint" )
1109
+ if ( !d->geometry || QgsWKBTypes::flatType ( d->geometry ->wkbType () ) != QgsWKBTypes:: MultiPoint )
1109
1110
{
1110
1111
return QgsMultiPoint ();
1111
1112
}
0 commit comments