Skip to content

SeaMon.forecast.*

Description

Queries weather forecast along a waypoint route or at a fixed location. These methods are a counterpart to the SeaMon-API /forecast HTTP endpoint, see SeaMon-API docs.

Functions

SeaMon.forecast.waypts

Fetches a SeaMon forecast along a great circle route between waypoints. This method is appropriate for forecasting shipping routes. Method returns a JavaScript promise object for handling response and exceptions.

function SeaMon.forecast.waypts(waypts,
                                params,    
                                opts={server="https://api.seamon.io",
                                      token="", 
                                      save=false})

SeaMon.forecast.route

Fetches a SeaMon forecast along predefined and supported routes in the SeaMon-API backend service, for example shipping lanes. Method returns a JavaScript promise object for handling response and exceptions.

function SeaMon.forecast.route(waypts,
                               params,    
                               opts={server="https://api.seamon.io",
                                     token="", 
                                     save=false})

SeaMon.forecast.drive

Fetches a SeaMon forecast between waypoints along a road network. Routes between waypoints are resolved using a road routing engine for shortest distances between waypoint locations. Method returns a JavaScript promise object for handling response and exceptions.

function SeaMon.forecast.drive(waypts,
                               params,    
                               opts={server="https://api.seamon.io",
                                     token="", 
                                     save=false})

Parameters

Parameter Value Description
waypts array of waypoints See waypoint definitions. e.g. [['Reykjavik','now'], ['Akureyri','80kph']]
params array of parameters Forecast model and parameters to query. See parameter definitions.
server string Sets SeaMon-API server if other than default
token string Unique access key, see authorization api.
save boolean [true/false] Stores forecast data response so that can be recalled and shared using the saved endpoint.

Example

SeaMon.forecast.drive([['Reykjavik','19-05-01T12:00'], ['Akureyri','80kph']],
                       ['wind', 'temp'])
  .then(data => {
    doSomething(data);
  })
  .catch(err => {
    console.error('caught exception:', err);
  });