File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,12 @@ QGis::WKBTYPE QgsGeometry::wkbType()
525
525
526
526
QGis::VectorType QgsGeometry::vectorType ()
527
527
{
528
+ if (mDirtyWkb )
529
+ {
530
+ // convert from GEOS
531
+ exportGeosToWkb ();
532
+ }
533
+
528
534
QGis::WKBTYPE type = wkbType ();
529
535
if (type == QGis::WKBPoint || type == QGis::WKBPoint25D ||
530
536
type == QGis::WKBMultiPoint || type == QGis::WKBMultiPoint25D)
@@ -541,6 +547,12 @@ QGis::VectorType QgsGeometry::vectorType()
541
547
542
548
bool QgsGeometry::isMultipart ()
543
549
{
550
+ if (mDirtyWkb )
551
+ {
552
+ // convert from GEOS
553
+ exportGeosToWkb ();
554
+ }
555
+
544
556
QGis::WKBTYPE type = wkbType ();
545
557
if (type == QGis::WKBMultiPoint ||
546
558
type == QGis::WKBMultiPoint25D ||
@@ -3020,7 +3032,17 @@ int QgsGeometry::makeDifference(QgsGeometry* other)
3020
3032
{
3021
3033
if (mGeos ->intersects (other->mGeos ))
3022
3034
{
3035
+ // check if multitype before and after
3036
+ bool multiType = isMultipart ();
3037
+
3023
3038
mGeos = mGeos ->difference (other->mGeos );
3039
+ mDirtyWkb = true ;
3040
+
3041
+ if (multiType && !isMultipart ())
3042
+ {
3043
+ convertToMultiType ();
3044
+ exportWkbToGeos ();
3045
+ }
3024
3046
}
3025
3047
else
3026
3048
{
@@ -3035,8 +3057,6 @@ int QgsGeometry::makeDifference(QgsGeometry* other)
3035
3057
return 6 ;
3036
3058
}
3037
3059
3038
- // set wkb dirty to true
3039
- mDirtyWkb = true ;
3040
3060
return 0 ;
3041
3061
}
3042
3062
You can’t perform that action at this time.
0 commit comments