Skip to content

Commit

Permalink
Raster reprojector: do not use full resolution hint when provider res…
Browse files Browse the repository at this point in the history
…ampling is enabled

Credits @nirvn
  • Loading branch information
rouault authored and nyalldawson committed Jun 19, 2020
1 parent 904a337 commit aaaf0f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/raster/qgsrasterprojector.cpp
Expand Up @@ -119,7 +119,11 @@ ProjectorData::ProjectorData( const QgsRectangle &extent, int width, int height,
QgsRasterDataProvider *provider = dynamic_cast<QgsRasterDataProvider *>( input->sourceInput() );
if ( provider )
{
if ( provider->capabilities() & QgsRasterDataProvider::Size )
// If provider-side resampling is enabled, we will get a much better looking
// result by not requesting at the maximum resolution and then doing nearest
// resampling here. A real fix would be to do resampling during reprojection
// however.
if ( !provider->isProviderResamplingEnabled() && ( provider->capabilities() & QgsRasterDataProvider::Size ) )
{
mMaxSrcXRes = provider->extent().width() / provider->xSize();
mMaxSrcYRes = provider->extent().height() / provider->ySize();
Expand Down

0 comments on commit aaaf0f7

Please sign in to comment.