Skip to content

Commit

Permalink
added disclaimer - Development funded from Regione Toscana - SITA
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Oct 17, 2013
1 parent b114dce commit 8eb6c91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -251,6 +251,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
// WMS/WMS-C tile expiry time
mDefaultTileExpirySpinBox->setValue( settings.value( "/qgis/defaultTileExpiry", "24" ).toInt() );

// Feature funded by Regione Toscana - SITA
// WMS/WMS-C default max retry in case of tile request errors
mDefaultTileMaxRetrySpinBox->setValue( settings.value( "/qgis/defaultTileMaxRetry", "3" ).toInt() );

Expand Down Expand Up @@ -902,6 +903,7 @@ void QgsOptions::saveOptions()
// WMS/WMS-C tile expiry time
settings.setValue( "/qgis/defaultTileExpiry", mDefaultTileExpirySpinBox->value() );

// Feature funded by Regione Toscana - SITA
// WMS/WMS-C default max retry in case of tile request errors
settings.setValue( "/qgis/defaultTileMaxRetry", mDefaultTileMaxRetrySpinBox->value() );

Expand Down
7 changes: 4 additions & 3 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -843,7 +843,6 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
}

int i = 0;
int retry = 0;
for ( int row = row0; row <= row1; row++ )
{
for ( int col = col0; col <= col1; col++ )
Expand All @@ -865,6 +864,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), i );
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ),
QRectF( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ) );
int retry = 0; // just for readability
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );

QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
Expand Down Expand Up @@ -902,7 +902,6 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
url.removeQueryItem( "TILECOL" );

int i = 0;
int retry = 0;
for ( int row = row0; row <= row1; row++ )
{
for ( int col = col0; col <= col1; col++ )
Expand All @@ -920,6 +919,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), i );
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ),
QRectF( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ) );
int retry = 0; // just for readability
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );

QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
Expand All @@ -944,7 +944,6 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
}

int i = 0;
int retry = 0;
for ( int row = row0; row <= row1; row++ )
{
for ( int col = col0; col <= col1; col++ )
Expand All @@ -962,6 +961,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), i );
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ),
QRectF( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ) );
int retry = 0; // just for readability
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );

QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
Expand Down Expand Up @@ -1039,6 +1039,7 @@ void QgsWmsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
//delete image;
}

// tile retry management developed with funding from Regione Toscana-SITA
void QgsWmsProvider::repeatTileRequest( QNetworkRequest const &oldRequest )
{
if ( mErrors == 100 )
Expand Down
2 changes: 2 additions & 0 deletions src/providers/wms/qgswmsprovider.h
Expand Up @@ -746,6 +746,8 @@ class QgsWmsProvider : public QgsRasterDataProvider
/**
* \brief Relaunch tile request cloning previous request parameters and managing max repeat
*
* \note Development funded by Regione Toscana - SITA
*
* \param oldRequest request to clone to generate new tile request
*
* request is not launched if max retry is reached. Message is logged.
Expand Down

0 comments on commit 8eb6c91

Please sign in to comment.