QGIS API Documentation 4.1.0-Master (376402f9aeb)
Loading...
Searching...
No Matches
QgsSunPositionCalculator Class Reference

Calculates the sun's position and related sun events for a given datetime. More...

#include <qgssunpositioncalculator.h>

Static Public Member Functions

static QgsSunPositionResult calculate (const QgsPointXY &point, const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context, const QDateTime &dateTime, double elevationMeters=0.0, double pressure=1013.25, double temperature=15.0)
 Calculates the solar position and events for a given point and time.

Detailed Description

Calculates the sun's position and related sun events for a given datetime.

This class is a high-level wrapper around the freespa algorithm for calculating solar position and events.

Warning
This class only supports sun position calculation from the Earth. Other celestial bodies are not supported.
Since
QGIS 4.2

Definition at line 84 of file qgssunpositioncalculator.h.

Member Function Documentation

◆ calculate()

QgsSunPositionResult QgsSunPositionCalculator::calculate ( const QgsPointXY & point,
const QgsCoordinateReferenceSystem & crs,
const QgsCoordinateTransformContext & context,
const QDateTime & dateTime,
double elevationMeters = 0.0,
double pressure = 1013.25,
double temperature = 15.0 )
static

Calculates the solar position and events for a given point and time.

Parameters
pointthe target point in the specified crs.
crsCoordinate Reference System associated with the point.
contextcoordinate transform context.
dateTimethe date and time for the calculation.
elevationMetersoptional elevation of the observer in meters above sea level.
pressureatmospheric pressure used for refraction correction (in millibars, hPa). The default is one standard atmosphere, or 1013.25 hPa.
temperaturethe local temperature used for refraction correction, in degrees Celsius.
Returns
A QgsSunPositionResult containing the calculated solar angles and event times.
Warning
This method only supports sun position calculation from the Earth. Other celestial bodies are not supported.
Exceptions
QgsCsExceptionif the point could not be transformed to WGS84
QgsInvalidArgumentExceptionwhen the specified arguments are invalid

Definition at line 34 of file qgssunpositioncalculator.cpp.


The documentation for this class was generated from the following files: