Skip to content
Permalink
Browse files
Update qgspostgresrasterprovider.cpp
  • Loading branch information
longhuan2018 authored and nyalldawson committed Oct 19, 2021
1 parent e4a8190 commit 7b7a7245560f7d621b5e91a76fc4abc53ba7c8b0
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/providers/postgres/raster/qgspostgresrasterprovider.cpp
@@ -1107,7 +1107,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 7b7a724

Please sign in to comment.