Skip to content

Commit

Permalink
PG raster: be tolerant if srid is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Sep 26, 2020
1 parent 84e2049 commit df564fd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/providers/postgres/qgspostgresdataitems.cpp
Expand Up @@ -389,10 +389,10 @@ QVector<QgsDataItem *> QgsPGSchemaItem::createChildren()
}

QVector<QgsPostgresLayerProperty> layerProperties;
bool ok = conn->supportedLayers( layerProperties,
QgsPostgresConn::geometryColumnsOnly( mConnectionName ),
QgsPostgresConn::publicSchemaOnly( mConnectionName ),
QgsPostgresConn::allowGeometrylessTables( mConnectionName ), mName );
const bool ok = conn->supportedLayers( layerProperties,
QgsPostgresConn::geometryColumnsOnly( mConnectionName ),
QgsPostgresConn::publicSchemaOnly( mConnectionName ),
QgsPostgresConn::allowGeometrylessTables( mConnectionName ), mName );

if ( !ok )
{
Expand All @@ -401,16 +401,16 @@ QVector<QgsDataItem *> QgsPGSchemaItem::createChildren()
return items;
}

bool dontResolveType = QgsPostgresConn::dontResolveType( mConnectionName );
bool estimatedMetadata = QgsPostgresConn::useEstimatedMetadata( mConnectionName );
const bool dontResolveType = QgsPostgresConn::dontResolveType( mConnectionName );
const bool estimatedMetadata = QgsPostgresConn::useEstimatedMetadata( mConnectionName );
const auto constLayerProperties = layerProperties;
for ( QgsPostgresLayerProperty layerProperty : constLayerProperties )
{
if ( layerProperty.schemaName != mName )
continue;

if ( !layerProperty.geometryColName.isNull() &&
//!layerProperty.isRaster &&
!layerProperty.isRaster &&
( layerProperty.types.value( 0, QgsWkbTypes::Unknown ) == QgsWkbTypes::Unknown ||
layerProperty.srids.value( 0, std::numeric_limits<int>::min() ) == std::numeric_limits<int>::min() ) )
{
Expand Down

0 comments on commit df564fd

Please sign in to comment.