WeatherSource

The WeatherSource is an abstract class that provides a standardized interface for accessing time-series weather data. It serves as a foundation for concrete implementations that fetch data from various providers (e.g., CSV files or SQL databases).

A WeatherSource relies on two key components:

  • IdCoordinateSource: Used to resolve a numeric coordinate ID from the source data into a geographic Point object.

  • TimeBasedWeatherValueFactory: Used to construct WeatherValue objects from the raw data fields.


Information

The source data for any WeatherSource implementation is expected to contain the following information.

Attribute

Remarks

coordinateid

An integer ID for a specific geographic coordinate. This ID is used to look up the actual Point via the IdCoordinateSource.

Time

The specific timestamp of the weather data, typically as a ZonedDateTime.

Weather Data

The meteorological values, such as solar irradiance (direct and diffuse), temperature, and wind data (speed and direction).

WeatherData

Weather data is comprised of five key components:

Component

Description

Unit

directIrradiance

Solar radiation that reaches the surface directly from the sun.

W/m²

diffuseIrradiance

Solar radiation scattered by the atmosphere before reaching the surface.

W/m²

temperature

Ambient air temperature.

K (Kelvin)

windVelocity

Wind speed.

m/s (meters per second)

windDirection

Wind direction, where 0° is North, 90° is East, etc.

° (degrees)

groundTemperatureLevel1

Ground temperature at level 1 for this coordinate.

K (Kelvin)

groundTemperatureLevel2

Ground temperature at level 2 for this coordinate.

K (Kelvin)

All components listed above are required, except groundTemperatureLevel1 and groundTemperatureLevel2, which are optional.

Weather data in COSMO and ICON formats is supported. Additional optional weather data can also be provided. The ground temperature measurements at level 1 and level 2 depth are used. Underground cables are typically laid at around 80 cm depth.