QGIS API Documentation
3.18.1-Zürich (202f1bf7e5)
|
Contains utility methods for working with temporal layers and projects. More...
#include <qgstemporalutils.h>
Classes | |
struct | AnimationExportSettings |
Contains settings relating to exporting animations. More... | |
Static Public Member Functions | |
static QDateTime | calculateFrameTime (const QDateTime &start, const long long frame, const QgsInterval interval) |
Calculates the frame time for an animation. More... | |
static QgsDateTimeRange | calculateTemporalRangeForProject (QgsProject *project) |
Calculates the temporal range for a project. More... | |
static bool | exportAnimation (const QgsMapSettings &mapSettings, const AnimationExportSettings &settings, QString &error, QgsFeedback *feedback=nullptr) |
Exports animation frames by rendering the map to multiple destination images. More... | |
Contains utility methods for working with temporal layers and projects.
Definition at line 36 of file qgstemporalutils.h.
|
static |
Calculates the frame time for an animation.
If the interval original duration is fractional or interval original unit is unknown (QgsUnitTypes::TemporalUnit::TemporalUnknownUnit), then QgsInterval is used to determine the duration of the frame. This uses average durations for months and years.
Otherwise, we use QDateTime to advance by the exact duration of the current month or year. So a time step of 1.5 months will result in a duration of 45 days, but a time step of 1 month will result in a duration that depends upon the number of days in the current month.
start | time of the animation |
frame | number |
interval | duration of the animation |
Definition at line 146 of file qgstemporalutils.cpp.
|
static |
Calculates the temporal range for a project.
This method considers the temporal range available from layers contained within the project and returns the maximal combined temporal extent of these layers.
Definition at line 31 of file qgstemporalutils.cpp.
|
static |
Exports animation frames by rendering the map to multiple destination images.
The mapSettings argument dictates the overall map settings such as extent and size, while animation and export specific settings are specified via the settings argument.
An optional feedback argument can be used to provide progress reports and cancellation support.
mapSettings | settings controlling the map render |
settings | animation and export settings |
error | will be set to a descriptive error message if the export fails |
feedback | optional feedback object for progress reports and cancellation checks |
true
if the export was successful. Definition at line 56 of file qgstemporalutils.cpp.