QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsrasterlayertemporalproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterlayertemporalproperties.h
3 ---------------
4 begin : February 2020
5 copyright : (C) 2020 by Samweli Mwakisambwe
6 email : samweli at kartoza dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18
19#ifndef QGSRASTERLAYERTEMPORALPROPERTIES_H
20#define QGSRASTERLAYERTEMPORALPROPERTIES_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
24#include "qgis.h"
25#include "qgsinterval.h"
26#include "qgsrange.h"
28
29class QgsRasterLayer;
30
39{
40 Q_OBJECT
41
42 public:
43
49 QgsRasterLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS = nullptr, bool enabled = false );
50
51 bool isVisibleInTemporalRange( const QgsDateTimeRange &range ) const override;
53 QList< QgsDateTimeRange > allTemporalRanges( QgsMapLayer *layer ) const override;
54
60 Qgis::RasterTemporalMode mode() const;
61
67 void setMode( Qgis::RasterTemporalMode mode );
68
72 QgsTemporalProperty::Flags flags() const override;
73
80 Qgis::TemporalIntervalMatchMethod intervalHandlingMethod() const;
81
88 void setIntervalHandlingMethod( Qgis::TemporalIntervalMatchMethod method );
89
100 void setFixedTemporalRange( const QgsDateTimeRange &range );
101
109 const QgsDateTimeRange &fixedTemporalRange() const;
110
119 QMap<int, QgsDateTimeRange> fixedRangePerBand() const;
120
129 void setFixedRangePerBand( const QMap<int, QgsDateTimeRange> &ranges );
130
139 int bandForTemporalRange( QgsRasterLayer *layer, const QgsDateTimeRange &range ) const;
140
146 QList< int > filteredBandsForTemporalRange( QgsRasterLayer *layer, const QgsDateTimeRange &range ) const;
147
155 int bandNumber() const;
156
164 void setBandNumber( int number );
165
174 QDateTime temporalRepresentationOffset() const;
175
184 void setTemporalRepresentationOffset( const QDateTime &offset );
185
194 const QgsInterval &temporalRepresentationScale() const;
195
204 void setTemporalRepresentationScale( const QgsInterval &scale );
205
206 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
207
208 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
209
211
212 private:
213
216
219
221 QgsDateTimeRange mFixedRange;
222
223 QMap< int, QgsDateTimeRange > mRangePerBand;
224
225 int mBandNumber = 1;
226
227 QDateTime mTemporalRepresentationOffset;
228 QgsInterval mTemporalRepresentationScale;
229};
230
231#endif // QGSRASTERLAYERTEMPORALPROPERTIES_H
TemporalIntervalMatchMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition qgis.h:2468
@ MatchUsingWholeRange
Use an exact match to the whole temporal range.
RasterTemporalMode
Raster layer temporal modes.
Definition qgis.h:2453
@ FixedTemporalRange
Mode when temporal properties have fixed start and end datetimes.
Base class for handling properties relating to a data provider's temporal capabilities.
A representation of the interval between two datetime values.
Definition qgsinterval.h:46
Base class for storage of map layer temporal properties.
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
virtual QgsDateTimeRange calculateTemporalExtent(QgsMapLayer *layer) const
Attempts to calculate the overall temporal extent for the specified layer, using the settings defined...
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
virtual QList< QgsDateTimeRange > allTemporalRanges(QgsMapLayer *layer) const
Attempts to calculate the overall list of all temporal extents which are contained in the specified l...
virtual bool isVisibleInTemporalRange(const QgsDateTimeRange &range) const
Returns true if the layer should be visible and rendered for the specified time range.
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads temporal properties from a DOM element previously written by writeXml().
Base class for all map layer types.
Definition qgsmaplayer.h:76
Implementation of map layer temporal properties for raster layers.
Represents a raster layer.
The class is used as a container of context for various read/write operations on other objects.
virtual QgsTemporalProperty::Flags flags() const
Returns flags associated to the temporal property.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:126