@@ -2524,27 +2524,27 @@ bool QgsPostgresProvider::getGeometryDetails()
2524
2524
fType = QString::fromUtf8 ( PQgetvalue ( result, 0 , 0 ) );
2525
2525
}
2526
2526
}
2527
- if ( fType == " POINT" )
2527
+ if ( fType == " POINT" || fType == " POINTM " )
2528
2528
{
2529
2529
geomType = QGis::WKBPoint;
2530
2530
}
2531
- else if ( fType == " MULTIPOINT" )
2531
+ else if ( fType == " MULTIPOINT" || fType == " MULTIPOINTM " )
2532
2532
{
2533
2533
geomType = QGis::WKBMultiPoint;
2534
2534
}
2535
- else if ( fType == " LINESTRING" )
2535
+ else if ( fType == " LINESTRING" || fType == " LINESTRINGM " )
2536
2536
{
2537
2537
geomType = QGis::WKBLineString;
2538
2538
}
2539
- else if ( fType == " MULTILINESTRING" )
2539
+ else if ( fType == " MULTILINESTRING" || fType == " MULTILINESTRINGM " )
2540
2540
{
2541
2541
geomType = QGis::WKBMultiLineString;
2542
2542
}
2543
- else if ( fType == " POLYGON" )
2543
+ else if ( fType == " POLYGON" || fType == " POLYGONM " )
2544
2544
{
2545
2545
geomType = QGis::WKBPolygon;
2546
2546
}
2547
- else if ( fType == " MULTIPOLYGON" )
2547
+ else if ( fType == " MULTIPOLYGON" || fType == " MULTIPOLYGONM " )
2548
2548
{
2549
2549
geomType = QGis::WKBMultiPolygon;
2550
2550
}
@@ -2565,7 +2565,18 @@ bool QgsPostgresProvider::getGeometryDetails()
2565
2565
tr ( " . The database communication log was:\n " ) );
2566
2566
showMessageBox ( tr ( " Unable to get feature type and srid" ), log );
2567
2567
}
2568
-
2568
+
2569
+ // store whether the geometry includes measure value
2570
+ if ( fType == " POINTM" || fType == " MULTIPOINTM" ||
2571
+ fType == " LINESTRINGM" || fType == " MULTILINESTRINGM" ||
2572
+ fType == " POLYGONM" || fType == " MULTIPOLYGONM" )
2573
+ {
2574
+ // explicitly disable adding new features and editing of geometries
2575
+ // as this would lead to corruption of measures
2576
+ enabledCapabilities &= ~(QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures);
2577
+ }
2578
+
2579
+
2569
2580
if ( valid )
2570
2581
{
2571
2582
QgsDebugMsg ( " SRID is " + srid );
0 commit comments