Skip to content

Commit fc372c9

Browse files
committed
Remove z/m -> 25D conversion in postgres provider (since z/m geoms are supported now)
1 parent 20abb7d commit fc372c9

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

src/providers/postgres/qgspostgresconn.cpp

+2-17
Original file line numberDiff line numberDiff line change
@@ -1520,28 +1520,13 @@ QGis::WkbType QgsPostgresConn::wkbTypeFromPostgis( QString type )
15201520
return ( QGis::WkbType )QgsWKBTypes::parseType( type );
15211521
}
15221522

1523-
QGis::WkbType QgsPostgresConn::wkbTypeFromOgcWkbType( unsigned int wkbType )
1523+
QgsWKBTypes::Type QgsPostgresConn::wkbTypeFromOgcWkbType( unsigned int wkbType )
15241524
{
15251525
// polyhedralsurface / TIN / triangle => MultiPolygon
15261526
if ( wkbType % 100 >= 15 )
15271527
wkbType = wkbType / 1000 * 1000 + QGis::WKBMultiPolygon;
15281528

1529-
switch ( wkbType / 1000 )
1530-
{
1531-
case 0:
1532-
break;
1533-
case 1: // Z
1534-
wkbType = 0x80000000 + wkbType % 100;
1535-
break;
1536-
case 2: // M => Z
1537-
wkbType = 0x80000000 + wkbType % 100;
1538-
break;
1539-
case 3: // ZM
1540-
wkbType = 0xc0000000 + wkbType % 100;
1541-
break;
1542-
}
1543-
1544-
return ( QGis::WkbType ) wkbType;
1529+
return ( QgsWKBTypes::Type ) wkbType;
15451530
}
15461531

15471532
QString QgsPostgresConn::displayStringForWkbType( QGis::WkbType type )

src/providers/postgres/qgspostgresconn.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class QgsPostgresConn : public QObject
258258
*/
259259
static QString quotedValue( QVariant value );
260260

261-
/**Get the list of supported layers
261+
/** Get the list of supported layers
262262
* @param layers list to store layers in
263263
* @param searchGeometryColumnsOnly only look for geometry columns which are
264264
* contained in the geometry_columns metatable
@@ -273,7 +273,7 @@ class QgsPostgresConn : public QObject
273273
bool allowGeometrylessTables = false,
274274
const QString schema = QString() );
275275

276-
/**Get the list of database schemas
276+
/** Get the list of database schemas
277277
* @param schemas list to store schemas in
278278
* @returns true if schemas where fetched successfully
279279
* @note added in QGIS 2.7
@@ -282,7 +282,7 @@ class QgsPostgresConn : public QObject
282282

283283
void retrieveLayerTypes( QgsPostgresLayerProperty &layerProperty, bool useEstimatedMetadata );
284284

285-
/**Gets information about the spatial tables
285+
/** Gets information about the spatial tables
286286
* @param searchGeometryColumnsOnly only look for geometry columns which are
287287
* contained in the geometry_columns metatable
288288
* @param searchPublicOnly
@@ -312,7 +312,7 @@ class QgsPostgresConn : public QObject
312312
static QString postgisTypeFilter( QString geomCol, QgsWKBTypes::Type wkbType, bool castToGeometry );
313313

314314
static QGis::WkbType wkbTypeFromGeomType( QGis::GeometryType geomType );
315-
static QGis::WkbType wkbTypeFromOgcWkbType( unsigned int ogcWkbType );
315+
static QgsWKBTypes::Type wkbTypeFromOgcWkbType( unsigned int ogcWkbType );
316316

317317
static QStringList connectionList();
318318
static QString selectedConnection();
@@ -375,7 +375,7 @@ class QgsPostgresConn : public QObject
375375
static QMap<QString, QgsPostgresConn *> sConnectionsRW;
376376
static QMap<QString, QgsPostgresConn *> sConnectionsRO;
377377

378-
/** count number of spatial columns in a given relation */
378+
/** Count number of spatial columns in a given relation */
379379
void addColumnInfo( QgsPostgresLayerProperty& layerProperty, const QString& schemaName, const QString& viewName, bool fetchPkCandidates );
380380

381381
//! List of the supported layers

0 commit comments

Comments
 (0)