Skip to content

Commit

Permalink
Remove z/m -> 25D conversion in postgres provider (since z/m geoms ar…
Browse files Browse the repository at this point in the history
…e supported now)
  • Loading branch information
mhugent committed Jul 24, 2015
1 parent 20abb7d commit fc372c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
19 changes: 2 additions & 17 deletions src/providers/postgres/qgspostgresconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
10 changes: 5 additions & 5 deletions src/providers/postgres/qgspostgresconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fc372c9

Please sign in to comment.