Skip to content
Permalink
Browse files

postgres provider: avoid point cloud error

  • Loading branch information
jef-n committed May 12, 2015
1 parent 74f10b9 commit c8aa777acb77084b5fed5a4fb4d82415e5ecb836
Showing with 13 additions and 7 deletions.
  1. +10 −7 src/providers/postgres/qgspostgresconn.cpp
  2. +3 −0 src/providers/postgres/qgspostgresconn.h
@@ -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;
}

@@ -359,6 +359,9 @@ class QgsPostgresConn : public QObject
//! PROJ4 capability
bool mProjAvailable;

//! pointcloud support available
bool mPointcloudAvailable;

//! encode wkb in hex
bool mUseWkbHex;

0 comments on commit c8aa777

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