Skip to content
Permalink
Browse files

PG raster: fix rounding error in tiles extent

  • Loading branch information
elpaso committed Jan 27, 2020
1 parent 2be9178 commit 0e47fb9759dea692f84623adc44146aa9cc64842
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/postgres/raster/qgspostgresrasterprovider.cpp
@@ -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 ) ) };

0 comments on commit 0e47fb9

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