Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 ccdba4e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/providers/wms/qgswmscapabilities.cpp
Expand Up @@ -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
{
Expand Down

0 comments on commit ccdba4e

Please sign in to comment.