Skip to content
Permalink
Browse files

Don't try to generate all available dates for wmst servers with a hug…

…e number of available dates

e.g. if a server has images for every hour for decades!
  • Loading branch information
nyalldawson committed Mar 25, 2021
1 parent 2bf6c0a commit ccdba4e340705ad94437ed2022929bb25c0a07f7
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/providers/wms/qgswmscapabilities.cpp
@@ -112,9 +112,18 @@ bool QgsWmsSettings::parseUri( const QString &uriString )
if ( !extent.resolution.isNull() )
{
bool maxValuesExceeded = false;
const QList< QDateTime > dates = QgsTemporalUtils::calculateDateTimesUsingDuration( begin, end, extent.resolution, maxValuesExceeded );
for ( const QDateTime &dt : dates )
mAllRanges.append( QgsDateTimeRange( dt, dt ) );
const QList< QDateTime > dates = QgsTemporalUtils::calculateDateTimesUsingDuration( begin, end, extent.resolution, maxValuesExceeded, 1000 );
// if we have a manageable number of distinct dates, then we'll use those. If not we just use the overall range.
// (some servers eg may have data for every minute for decades!)
if ( !maxValuesExceeded )
{
for ( const QDateTime &dt : dates )
mAllRanges.append( QgsDateTimeRange( dt, dt ) );
}
else
{
mAllRanges.append( QgsDateTimeRange( begin, end ) );
}
}
else
{

0 comments on commit ccdba4e

Please sign in to comment.