Skip to content
Permalink
Browse files

PG raster: be tolerant if srid is 0

  • Loading branch information
elpaso authored and nyalldawson committed Sep 26, 2020
1 parent 84e2049 commit df564fd1afdea09da7700ffd3a722b0b2e952846
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/providers/postgres/qgspostgresdataitems.cpp
@@ -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 )
{
@@ -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() ) )
{

0 comments on commit df564fd

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