Skip to content
Permalink
Browse files
Update qgspostgresrasterprovider.cpp
  • Loading branch information
longhuan2018 authored and nyalldawson committed Oct 18, 2021
1 parent 738fe8f commit 1f8aa469bc29f76d9adea7f4e77422154e858995
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/providers/postgres/raster/qgspostgresrasterprovider.cpp
@@ -1109,7 +1109,8 @@ bool QgsPostgresRasterProvider::init()

QgsPostgresResult extentResult( connectionRO()->PQexec( extentSql ) );
const QByteArray extentHexAscii { extentResult.PQgetvalue( 0, 0 ).toLatin1() };
QgsConstWkbPtr extentPtr { QByteArray::fromHex( extentHexAscii ) };
const QByteArray extentHexBin = QByteArray::fromHex( extentHexAscii );
QgsConstWkbPtr extentPtr { extentHexBin };
if ( extentHexAscii.isEmpty() || ! p.fromWkb( extentPtr ) )
{
throw QgsPostgresRasterProviderException( tr( "Cannot get extent from raster" ) );
@@ -1259,7 +1260,8 @@ bool QgsPostgresRasterProvider::init()
QgsPolygon p;
try
{
QgsConstWkbPtr ptr { QByteArray::fromHex( result.PQgetvalue( 0, 0 ).toLatin1() ) };
const QByteArray hexBin = QByteArray::fromHex( result.PQgetvalue( 0, 0 ).toLatin1() );
QgsConstWkbPtr ptr { hexBin };
if ( ! p.fromWkb( ptr ) )
{
QgsMessageLog::logMessage( tr( "Cannot get extent from raster" ),

0 comments on commit 1f8aa46

Please sign in to comment.