File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1298,6 +1298,12 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert
1298
1298
query += QString::number ( srid );
1299
1299
}
1300
1300
1301
+ query += " ," ;
1302
+ query += QString ( " %1(%2%3)" )
1303
+ .arg ( majorVersion () < 2 ? " ndims" : " st_ndims" )
1304
+ .arg ( quotedIdentifier ( layerProperty.geometryColName ) )
1305
+ .arg ( layerProperty.geometryColType == sctGeography ? " ::geometry" : " " );
1306
+
1301
1307
query += " FROM " + table;
1302
1308
1303
1309
// QgsDebugMsg( "Retrieving geometry types: " + query );
@@ -1310,6 +1316,10 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert
1310
1316
{
1311
1317
QString type = gresult.PQgetvalue ( i, 0 );
1312
1318
QString srid = gresult.PQgetvalue ( i, 1 );
1319
+ QString ndims = gresult.PQgetvalue ( i, 2 );
1320
+
1321
+ if ( ndims.toInt () > 2 ) layerProperty.force2d = true ;
1322
+
1313
1323
if ( type.isEmpty () )
1314
1324
continue ;
1315
1325
You can’t perform that action at this time.
0 commit comments