Skip to content
Permalink
Browse files

PG raster: fix WKB parser band number

  • Loading branch information
elpaso committed Jan 26, 2020
1 parent f82932e commit f82298f5f9ef649e8972fae611b1de1b38c8c8d2
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/providers/postgres/raster/qgspostgresrasterutils.cpp
@@ -18,7 +18,6 @@
#include "qgspostgresrasterutils.h"
#include "qgsmessagelog.h"


QVariantMap QgsPostgresRasterUtils::parseWkb( const QByteArray &wkb, int bandNo )
{
QVariantMap result;
@@ -53,8 +52,7 @@ QVariantMap QgsPostgresRasterUtils::parseWkb( const QByteArray &wkb, int bandNo
// TODO: endianness
Q_ASSERT( result[ QStringLiteral( "endiannes" ) ] == 1 ); //#spellok
result[ QStringLiteral( "version" ) ] = *reinterpret_cast<const unsigned short int *>( &wkb.constData()[1] );
result[ QStringLiteral( "nBands" ) ] = *reinterpret_cast<const unsigned int *>( &wkb.constData()[3] );
const unsigned int nBands { *reinterpret_cast<const unsigned int *>( &wkb.constData()[3] ) };
const unsigned short int nBands { *reinterpret_cast<const unsigned short int *>( &wkb.constData()[3] ) };
result[ QStringLiteral( "nBands" ) ] = nBands;
result[ QStringLiteral( "scaleX" ) ] = *reinterpret_cast<const double *>( &wkb.constData()[5] );
result[ QStringLiteral( "scaleY" ) ] = *reinterpret_cast<const double *>( &wkb.constData()[13] );

0 comments on commit f82298f

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