File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -3243,7 +3243,13 @@ int QgsGeometry::reshapeGeometry( const QList<QgsPoint>& reshapeWithLine )
3243
3243
return 1 ;
3244
3244
}
3245
3245
3246
- bool isMultiGeom = ( numGeoms > 1 );
3246
+ bool isMultiGeom = false ;
3247
+ int geosTypeId = GEOSGeomTypeId ( mGeos );
3248
+ if ( geosTypeId == GEOS_MULTILINESTRING || geosTypeId == GEOS_MULTIPOLYGON )
3249
+ {
3250
+ isMultiGeom = true ;
3251
+ }
3252
+
3247
3253
bool isLine = ( type () == QGis::Line );
3248
3254
3249
3255
// polygon or multipolygon?
@@ -3303,7 +3309,16 @@ int QgsGeometry::reshapeGeometry( const QList<QgsPoint>& reshapeWithLine )
3303
3309
}
3304
3310
GEOSGeom_destroy ( reshapeLineGeos );
3305
3311
3306
- GEOSGeometry* newMultiGeom = GEOSGeom_createCollection ( GEOS_MULTIPOLYGON, newGeoms, numGeoms );
3312
+ GEOSGeometry* newMultiGeom = 0 ;
3313
+ if ( isLine )
3314
+ {
3315
+ newMultiGeom = GEOSGeom_createCollection ( GEOS_MULTILINESTRING, newGeoms, numGeoms );
3316
+ }
3317
+ else // multipolygon
3318
+ {
3319
+ newMultiGeom = GEOSGeom_createCollection ( GEOS_MULTIPOLYGON, newGeoms, numGeoms );
3320
+ }
3321
+
3307
3322
delete[] newGeoms;
3308
3323
if ( ! newMultiGeom )
3309
3324
{
You can’t perform that action at this time.
0 commit comments