Skip to content
Permalink
Browse files

Remove z/m -> 25D conversion in postgres provider (since z/m geoms ar…

…e supported now)
  • Loading branch information
mhugent committed Jul 24, 2015
1 parent 20abb7d commit fc372c9829f0a90534deeb6db5e319176fc9c9d0
Showing with 7 additions and 22 deletions.
  1. +2 −17 src/providers/postgres/qgspostgresconn.cpp
  2. +5 −5 src/providers/postgres/qgspostgresconn.h
@@ -1520,28 +1520,13 @@ QGis::WkbType QgsPostgresConn::wkbTypeFromPostgis( QString type )
return ( QGis::WkbType )QgsWKBTypes::parseType( type );
}

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

switch ( wkbType / 1000 )
{
case 0:
break;
case 1: // Z
wkbType = 0x80000000 + wkbType % 100;
break;
case 2: // M => Z
wkbType = 0x80000000 + wkbType % 100;
break;
case 3: // ZM
wkbType = 0xc0000000 + wkbType % 100;
break;
}

return ( QGis::WkbType ) wkbType;
return ( QgsWKBTypes::Type ) wkbType;
}

QString QgsPostgresConn::displayStringForWkbType( QGis::WkbType type )
@@ -258,7 +258,7 @@ class QgsPostgresConn : public QObject
*/
static QString quotedValue( QVariant value );

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

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

void retrieveLayerTypes( QgsPostgresLayerProperty &layerProperty, bool useEstimatedMetadata );

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

static QGis::WkbType wkbTypeFromGeomType( QGis::GeometryType geomType );
static QGis::WkbType wkbTypeFromOgcWkbType( unsigned int ogcWkbType );
static QgsWKBTypes::Type wkbTypeFromOgcWkbType( unsigned int ogcWkbType );

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

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

//! List of the supported layers

0 comments on commit fc372c9

Please sign in to comment.
You can’t perform that action at this time.