Skip to content
Permalink
Browse files

Improve logic for automatic calculation of project temporal range

  • Loading branch information
nyalldawson committed Mar 12, 2020
1 parent 19499f3 commit 088696f382bffc549337fb28a5455c9c3ce4c0aa
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/app/qgsprojectproperties.cpp
@@ -2527,7 +2527,17 @@ void QgsProjectProperties::calculateFromLayersButton_clicked()
{
QgsRasterLayer *rasterLayer = qobject_cast<QgsRasterLayer *>( currentLayer );

QgsDateTimeRange layerRange = rasterLayer->temporalProperties()->fixedTemporalRange();
QgsDateTimeRange layerRange;
switch ( rasterLayer->temporalProperties()->mode() )
{
case QgsRasterLayerTemporalProperties::ModeFixedTemporalRange:
layerRange = rasterLayer->temporalProperties()->fixedTemporalRange();
break;

case QgsRasterLayerTemporalProperties::ModeTemporalRangeFromDataProvider:
layerRange = rasterLayer->dataProvider()->temporalCapabilities()->availableTemporalRange();
break;
}

if ( !minDate.isValid() || layerRange.begin() < minDate )
minDate = layerRange.begin();

0 comments on commit 088696f

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