Skip to content
Permalink
Browse files

Merge pull request #36422 from elpaso/bugfix-gh34813-osm-tiles-followup

Folloup to PR 36399 OSM prefetch
  • Loading branch information
elpaso committed May 14, 2020
2 parents 84c4d8d + 720eefc commit 97cbb3e1a1edf6c910308c7afaed70479b5c895b
@@ -64,7 +64,7 @@ void QgsRasterLayerRendererFeedback::onNewData()
///
QgsRasterLayerRenderer::QgsRasterLayerRenderer( QgsRasterLayer *layer, QgsRenderContext &rendererContext )
: QgsMapLayerRenderer( layer->id(), &rendererContext )
, mLayer( layer )
, mProviderCapabilities( static_cast<QgsRasterDataProvider::Capability>( layer->dataProvider()->capabilities() ) )
, mFeedback( new QgsRasterLayerRendererFeedback( this ) )
{
QgsMapToPixel mapToPixel = rendererContext.mapToPixel();
@@ -266,9 +266,8 @@ QgsRasterLayerRenderer::~QgsRasterLayerRenderer()
bool QgsRasterLayerRenderer::render()
{
// Skip rendering of out of view tiles (xyz)
if ( !mRasterViewPort || ( mLayer && renderContext()->testFlag( QgsRenderContext::Flag::RenderPreviewJob ) &&
mLayer->dataProvider() &&
!( mLayer->dataProvider()->capabilities() &
if ( !mRasterViewPort || ( renderContext()->testFlag( QgsRenderContext::Flag::RenderPreviewJob ) &&
!( mProviderCapabilities &
QgsRasterInterface::Capability::Prefetch ) ) )
return true;

@@ -19,6 +19,7 @@
#define SIP_NO_FILE

#include "qgsmaplayerrenderer.h"
#include "qgsrasterdataprovider.h"

class QPainter;

@@ -80,7 +81,7 @@ class CORE_EXPORT QgsRasterLayerRenderer : public QgsMapLayerRenderer

QgsRasterPipe *mPipe = nullptr;

QgsRasterLayer *mLayer;
QgsRasterDataProvider::Capability mProviderCapabilities;

//! feedback class for cancellation and preview generation
QgsRasterLayerRendererFeedback *mFeedback = nullptr;
@@ -743,24 +743,24 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in
return image;
}

QgsDebugMsg( QStringLiteral( "layer extent: %1,%2,%3,%4 %5x%6" )
.arg( qgsDoubleToString( mLayerExtent.xMinimum() ),
qgsDoubleToString( mLayerExtent.yMinimum() ) )
.arg( qgsDoubleToString( mLayerExtent.xMaximum() ),
qgsDoubleToString( mLayerExtent.yMaximum() ) )
.arg( mLayerExtent.width() )
.arg( mLayerExtent.height() )
);
QgsDebugMsgLevel( QStringLiteral( "layer extent: %1,%2,%3,%4 %5x%6" )
.arg( qgsDoubleToString( mLayerExtent.xMinimum() ),
qgsDoubleToString( mLayerExtent.yMinimum() ) )
.arg( qgsDoubleToString( mLayerExtent.xMaximum() ),
qgsDoubleToString( mLayerExtent.yMaximum() ) )
.arg( mLayerExtent.width() )
.arg( mLayerExtent.height() ), 3
);

QgsDebugMsg( QStringLiteral( "view extent: %1,%2,%3,%4 %5x%6 res:%7" )
.arg( qgsDoubleToString( viewExtent.xMinimum() ),
qgsDoubleToString( viewExtent.yMinimum() ) )
.arg( qgsDoubleToString( viewExtent.xMaximum() ),
qgsDoubleToString( viewExtent.yMaximum() ) )
.arg( viewExtent.width() )
.arg( viewExtent.height() )
.arg( vres, 0, 'f' )
);
QgsDebugMsgLevel( QStringLiteral( "view extent: %1,%2,%3,%4 %5x%6 res:%7" )
.arg( qgsDoubleToString( viewExtent.xMinimum() ),
qgsDoubleToString( viewExtent.yMinimum() ) )
.arg( qgsDoubleToString( viewExtent.xMaximum() ),
qgsDoubleToString( viewExtent.yMaximum() ) )
.arg( viewExtent.width() )
.arg( viewExtent.height() )
.arg( vres, 0, 'f' ), 3
);

QgsDebugMsgLevel( QStringLiteral( "tile matrix %1,%2 res:%3 tilesize:%4x%5 matrixsize:%6x%7 id:%8" )
.arg( tm->topLeft.x() ).arg( tm->topLeft.y() ).arg( tm->tres )

0 comments on commit 97cbb3e

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