diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp index cc6054a9fea0..5a97336a9aa0 100644 --- a/src/providers/postgres/qgspostgresconn.cpp +++ b/src/providers/postgres/qgspostgresconn.cpp @@ -393,7 +393,8 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP } else if ( i == sctTopoGeometry ) { - if ( ! hasTopology() ) continue; + if ( !hasTopology() ) + continue; schemaName = "l.schema_name"; tableName = "l.table_name"; @@ -411,7 +412,8 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP } else if ( i == sctPcPatch ) { - if ( ! hasPointcloud() ) continue; + if ( !hasPointcloud() ) + continue; tableName = "l.\"table\""; schemaName = "l.\"schema\""; @@ -757,7 +759,6 @@ bool QgsPostgresConn::hasGEOS() { // make sure info is up to date for the current connection postgisVersion(); - // get geos capability return mGeosAvailable; } @@ -768,7 +769,6 @@ bool QgsPostgresConn::hasTopology() { // make sure info is up to date for the current connection postgisVersion(); - // get topology capability return mTopologyAvailable; } @@ -777,9 +777,9 @@ bool QgsPostgresConn::hasTopology() */ bool QgsPostgresConn::hasPointcloud() { - // TODO: use mPointcloudAvailable function instead - QgsPostgresResult result = PQexec( "SELECT 'pointcloud_columns'::regclass" ); - return result.PQntuples() == 1; + // make sure info is up to date for the current connection + postgisVersion(); + return mPointcloudAvailable; } /* Functions for determining available features in postGIS */ @@ -866,6 +866,9 @@ QString QgsPostgresConn::postgisVersion() mGotPostgisVersion = true; + result = PQexec( "SELECT 'pointcloud_columns'::regclass", false ); + mPointcloudAvailable = result.PQntuples() == 1; + return mPostgisVersionInfo; } diff --git a/src/providers/postgres/qgspostgresconn.h b/src/providers/postgres/qgspostgresconn.h index 05025c8bce39..fbb3d1b83cad 100644 --- a/src/providers/postgres/qgspostgresconn.h +++ b/src/providers/postgres/qgspostgresconn.h @@ -359,6 +359,9 @@ class QgsPostgresConn : public QObject //! PROJ4 capability bool mProjAvailable; + //! pointcloud support available + bool mPointcloudAvailable; + //! encode wkb in hex bool mUseWkbHex;