File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5448,7 +5448,20 @@ QgsGeometry* QgsGeometry::combine( QgsGeometry* geometry )
5448
5448
5449
5449
try
5450
5450
{
5451
- return fromGeosGeom ( GEOSUnion ( mGeos , geometry->mGeos ) );
5451
+ GEOSGeometry* unionGeom = GEOSUnion ( mGeos , geometry->mGeos );
5452
+ QGis::WkbType thisGeomType = wkbType ();
5453
+ QGis::WkbType otherGeomType = geometry->wkbType ();
5454
+ if ( (thisGeomType == QGis::WKBLineString || thisGeomType == QGis::WKBLineString25D) \
5455
+ && (otherGeomType == QGis::WKBLineString || otherGeomType == QGis::WKBLineString25D) )
5456
+ {
5457
+ GEOSGeometry* mergedGeom = GEOSLineMerge (unionGeom);
5458
+ if (mergedGeom)
5459
+ {
5460
+ GEOSGeom_destroy (unionGeom);
5461
+ unionGeom = mergedGeom;
5462
+ }
5463
+ }
5464
+ return fromGeosGeom (unionGeom);
5452
5465
}
5453
5466
CATCH_GEOS ( new QgsGeometry ( *this ) ) // return this geometry if union not possible
5454
5467
}
You can’t perform that action at this time.
0 commit comments