GriddedGeoLayer

open class GriddedGeoLayer<T> @JvmOverloads constructor(environment: Environment<*, GeoPosition>, data: GridSnapshots, converter: (Double) -> T, timeScale: String = DEFAULT_TIME_SCALE.toIsoString(), timeOrigin: String? = null, spatialInterpolation: SpatialInterpolation = BilinearInterpolation, temporalInterpolation: TemporalInterpolation = LinearInterpolation) : GeoLayer<T>

A GeoLayer over gridded geographic data changing over time, such as weather or climate data. At each simulation time, the value at a position is interpolated with spatialInterpolation in the two grids around that time, then between them with temporalInterpolation, and finally converted by converter. Before the first and after the last instant of the data, the first and last grids are used. Positions outside the grid fail as soon as they are sampled.

Parameters

environment

the environment, whose simulation provides the time.

data

the data, such as GridsFromDirectory or CopernicusData.

converter

how to turn the interpolated values, Double.NaN if missing, into the values of the layer.

timeScale

the real-world duration of a simulation time unit, as an ISO-8601 duration (e.g., PT6H).

timeOrigin

the real-world instant of simulation time 0, as an ISO-8601 instant (e.g., 2024-06-10T00:00:00Z); the first instant of data when null.

spatialInterpolation

how to compute values between the nodes of a grid.

temporalInterpolation

how to compute values between two instants of the data.

Throws

if data is empty, if its instants are not strictly ascending, if timeScale is not a positive finite ISO-8601 duration, or if timeOrigin is not an ISO-8601 instant.

Inheritors

Constructors

Link copied to clipboard
constructor(environment: Environment<*, GeoPosition>, data: GridSnapshots, converter: (Double) -> T, timeScale: String = DEFAULT_TIME_SCALE.toIsoString(), timeOrigin: String? = null, spatialInterpolation: SpatialInterpolation = BilinearInterpolation, temporalInterpolation: TemporalInterpolation = LinearInterpolation)

Types

Link copied to clipboard
object Companion

Defaults of the layer.

Functions

Link copied to clipboard
open fun currentValueAt(position: GeoPosition): T

The current value at position.

Link copied to clipboard
Link copied to clipboard
open override fun valueAt(position: GeoPosition): Observable<T>

The value at position, following the time of the simulation, or time 0 until there is one. Reading or observing it fails with an IllegalArgumentException if position is outside the grid.