Forecast Matrix Requests
This endpoint returns what can be thought of as a two-dimensial matrix of weather
forecasts for multiple GPS coordinates:
- The first dimension is a range of GPS coordinates.
- The second dimension is a set of forecast snapshots corresponding to that location, where the forecast may be for a specific hour or day.
The weather forecasts inside this matrix are identical to the individual responses from the
Single Forecast
resource, but nested inside a top-level array corresponding to the GPS coordinates provided.
A weather matrix provides a full set of forecasts that can be utilized for
different purposes. Some examples include:
- Displaying relevant forecasts along a route.
- Adapting forecasts along that route, such as planning for stops of certain time lengths.
- Scanning for particular weather conditions of interest (or the "worst conditions") along a route.
- Conditionally displaying severe weather alerts, depending on the time and location of the alerts.
- Simply retrieving a batch of results for multiple disjoint locations with no interrelation, much like basic weather apps will provide forecasts at multiple chosen cities.
- Or, a unique purpose that you may have in mind!
If the intent of your weather matrix is to be used in conjunction with routing along a
trajectory, be sure to provide the trajectory points in order of travel! This makes it
easy to progressively "step" through the matrix results along the trajectory.
Query Parameters
point
A comma-separated
latitude,longitude
GPS coordinate string. (required; multiple allowed)
mode
Desired mode of transit. Choice of transit will affect the scoring of the weather
matrix.
Available transit modes:
car
- Default routing and weather responsestruck
- Routing avoids small roads; weather results are sensitive to high windsmotorcycle
- No impact on routing; weather results are sensitive to precipitationbicycle
- No impact on routing; weather results are sensitive to precipitation
(optional; default=
car
)units
The preferred units of the response.
Available units:
imperial
- Imperial units (Fahrenheit and/or miles)metric
- Metric units (Celsius and/or kilometers)
(optional; default=
imperial
)Cost
15 points x the number of locations requested
Sample Query
GET https://api.weatherroute.io/v1/weather/forecast-matrix?point=39.526,-119.813&point=39.256,-120.735&point=38.582,-121.494
Output
This request returns a ForecastMatrix response object.
This endpoint returns an array of forecast results. The individual objects within the
array are identical to the
Single Forecast response, but nested inside the top-level array.
Forecast responses in the array are
returned in the same order in which their respective GPS coordinates are provided
as query parameters.
Sample output
[ { "latitude": 39.526, "longitude": -119.813, "hourly": [{ ... }], "daily": [{ ... }], "alerts": [{ ... }] }, { "latitude": 39.526, "longitude": -120.513, "hourly": [{ ... }], "daily": [{ ... }], "alerts": [{ ... }] }, ... ]