Skip to content

Commit

Permalink
PG raster: fix rounding error in tiles extent
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jan 27, 2020
1 parent 2be9178 commit 0e47fb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/postgres/raster/qgspostgresrasterprovider.cpp
Expand Up @@ -415,8 +415,8 @@ bool QgsPostgresRasterProvider::readBlock( int bandNo, const QgsRectangle &viewE
const QgsRectangle &tilesExtent { tileResponse.extent };

// Prepare tmp output raster
const int tmpWidth = static_cast<int>( tilesExtent.width() / tileResponse.tiles.first().scaleX );
const int tmpHeight = static_cast<int>( tilesExtent.height() / std::fabs( tileResponse.tiles.first().scaleY ) );
const int tmpWidth = static_cast<int>( std::round( tilesExtent.width() / tileResponse.tiles.first().scaleX ) );
const int tmpHeight = static_cast<int>( std::round( tilesExtent.height() / std::fabs( tileResponse.tiles.first().scaleY ) ) );

GDALDataType gdalDataType { static_cast<GDALDataType>( sourceDataType( bandNo ) ) };

Expand Down

0 comments on commit 0e47fb9

Please sign in to comment.