Skip to content

Commit

Permalink
Merge pull request #34053 from elpaso/bugfix-pgraster-rounding-error-…
Browse files Browse the repository at this point in the history
…in-tiles-extent

PG raster: fix rounding error in tiles extent
  • Loading branch information
elpaso committed Jan 27, 2020
2 parents ee28568 + 0e47fb9 commit 1c21326
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 1c21326

Please sign in to comment.