Client
Client providing access to weather data from WeatherLayers Cloud or a compatible catalog
Example
Configure client with your WeatherLayers Cloud access token created in WeatherLayers Account.
Constructor
Client(config: ClientConfig = {})
Client(config: ClientConfig = {})
Config properties
url
url
Type: string, optional
Default: https://catalog.weatherlayers.com
(WeatherLayers Cloud)
Catalog url
accessToken
accessToken
Type: string, optional
Default: none (but required for WeatherLayers Cloud)
Catalog access token
dataFormat
dataFormat
Type: string, optional
Default: byte.png
GeoTIFF requires geotiff.js as a peer dependency.
unitSystem
unitSystem
Type: UnitSystem
, optional
Default: METRIC
Unit system for unit format definition.
attributionLinkClass
attributionLinkClass
Type: string, optional
Attribution link class, used in Dataset
, attribution
field
datetimeStep
datetimeStep
Type: number, optional
Default: 1
Minimal step in hours between datetimes.
datetimeInterpolate
datetimeInterpolate
Type: boolean, optional
Enable datetime interpolation.
For example, if a datetime 6:30 is requested, but 6:00 and 7:00 exist, { image: <6:00>, image2: <7:00>, imageWeight: 0.5 }
is returned by loadDatasetData
.
Methods
loadCatalog(): Promise<string[]>
loadCatalog(): Promise<string[]>
Loads dataset ids from the catalog.
Loads dataset metadata from the catalog.
loadDatasetSlice(dataset: string, datetimeRange:
DatetimeISOStringRange
, config: ClientConfig = {}): Promise<
DatasetSlice
>
loadDatasetSlice(dataset: string, datetimeRange:
DatetimeISOStringRange
, config: ClientConfig = {}): Promise<
DatasetSlice
>
Loads dataset slice with available datetimes in the given datetime range from the catalog.
The current data with offset can be loaded by providing datetimeRange = WeatherLayers.offsetDatetimeRange(new Date().toISOString(), 0, 24)
.
loadDatasetData(dataset: string, datetime:
DatetimeISOString
, config: ClientConfig = {}): Promise<
DatasetData
>
loadDatasetData(dataset: string, datetime:
DatetimeISOString
, config: ClientConfig = {}): Promise<
DatasetData
>
Loads dataset data at the given datetime from the catalog.
The current data can be loaded by providing datetime = new Date().toISOString()
.
Last updated