Weather Notifications
Contents
(Available in North America only)
The Weather Notifications service can help you plan ahead to avoid potential delays and hazardous road conditions, and warn drivers when they are approaching bad weather. The service looks ahead along the planned route, and it uses predictive, hyperlocal weather data to issue alerts if the driver is expected to encounter inclement weather.
The alerts are automatically returned via a WebSocket connection:
- For an entire route, at the time a route is calculated. The alerts are based on the predicted weather conditions at the time the driver is expected to reach that point in the route. Alerts provide the time the driver will reach the location of that weather event.
- As the driver progresses along the route. The weather service checks for alerts with every GPS ping received from a vehicle on its route. If the weather changes or expires at a certain location, then the alert is re-sent with the published state as
expired
, and a new alert is issued.
The service, which uses weather data from WeatherOptics, is available as a premium add-on feature.
Trimble Transportation Management System (TMS) and CoPilot navigation customers may be able to receive hyperlocal weather notifications through existing “out of the box” solutions, without needing to follow the integration steps below. Contact us or reach out to your Trimble account rep to learn more.
Setting up weather notifications
Weather alerts are received via push notifications. In order to connect, the integration should use a WebSocket client. Registration requires the following URL to establish the connection:
https://notifications.trimblemaps.com/register?apikey={yourAPIkeyHERE}
Use MethodName = notificationMessage
If the connection succeeds, you will receive the response: “Connected to notifications.trimblemaps.com/register”
If the connection fails, please contact us at to verify your API key.
To Disconnect
Notifications will keep coming until you disconnect from WebSocket via the Websocket.close() method.
(These methods might vary slightly depending on the coding language.)
WebSocket client example
C# WebSocket
NuGet package needed: "Microsoft.AspNetCore.SignalR.Client" Version="6.0.5"
C# Sample Code
var connection = new HubConnectionBuilder()
.WithUrl("https://notifications.trimblemaps.com/register?apikey={Your API Key here}")
.WithAutomaticReconnect(new [] {TimeSpan.FromSeconds(5)})
.Build();
connection.On<dynamic>("notificationMessage", (message) =>
{
try
{
Console.WriteLine($"message: {message}");
}
catch (Exception ex)
{
Console.WriteLine($"Exception: {ex}");
} });
try
{
await connection.StartAsync();
Console.WriteLine("Connection started");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
await Task.Delay(new Random().Next(0, 5) * 100000);
await connection.StartAsync();
}
Console.ReadLine();
Sample response
{
"type": 1,
"target": "notificationMessage",
"arguments": [
{
"properties": {
"ownerId": 512482991,
"accountId": 100364594,
"tripId": "233220014",
"tmsTripId": "test_weather_notification",
"tripURL": "https://tripmanagement.alk.com/trip-viewer/token/05otrzkh73lhr4fvjra3whnturn9dxmp7vs94rql5e/details/233220014?region=NA",
"distanceUOM": "Miles",
"precipitationUOM": "Inches",
"temperatureUOM": "Fahrenheit",
"notificationType": "weather_notification_v2",
"weatherNotificationId": "fad00975-30c7-40c7-ac6e-46ad26d4a09c",
"slowdownSummary": 20.37,
"weatherSummary": [
"snow",
"rain",
"freezingRain",
"sleet",
"visibility",
"extremeWeather",
"dustStormWarning"
],
"riskSummary": {
"maxRoadRisk": "Critical",
"maxRoadIndex": 9,
"maxCrashRisk": "Critical",
"maxCrashIndex": "8",
"maxDisruptionRisk": "High",
"maxDisruptionIndex": "7",
"maxTippingIndex": "0.89",
"minVisibility": 0.1,
"maxTemperature": 70,
"minTemperature": 45
},
"weatherImpact": [
{
"lineColor": "yellow",
"impactRoadRisk": "Moderate",
"impactMaxCrashRisk": "Moderate",
"impactMaxDisruptionRisk": "Moderate",
"impactMaxRoadIndex": 5,
"impactStartPoint": "-89.626376 68.44377",
"impactEndPoint": "-89.617485 68.438454",
"impactRouteLine": null,
"impactLength": 0.61,
"impactSummary": [],
"custMsgId": null,
"impactMaxTippingIndex": 0,
"impactMaxWindGust": 20,
"impactMaxWindSpeed": 13,
"impactMaxPrecipitation": 0,
"impactMaxRainfall": 0,
"impactMaxSnowfall": 0,
"impactMaxRainAccumulation": 0,
"impactMaxSnowAccumulation": 0,
"impactMaxFreezingRainAccumulation": 0,
"impactMaxFloodIndex": 0.2,
"impactMaxHeatIndex": 39,
"impactMaxTemperature": 45,
"impactMinTemperature": 45,
"weatherAlerts": [],
"weatherGrids": [
{
"weatherGrid": {
"weatherGridId": 54608865,
"distanceToEvent": 2.17,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T10:55:29.1093427-07:00",
"roadIndex": 5,
"crashIndex": 5,
"disruptionIndex": 5,
"speedReduction": 0.05,
"windGust": 20,
"windSpeed": 13,
"totalPrecipitation": 0,
"totalRainfall": 0,
"totalSnowfall": 0,
"rainAccumulation": 0,
"snowAccumulation": 0,
"freezingRainAccumulation": 0,
"floodIndex": 0.2,
"tippingIndex": 0,
"visibility": 5,
"temperature": 45,
"heatIndex": 39
},
"startPoint": "-89.626376 68.44377",
"endPoint": "-89.617485 68.438454"
}
],
"publishState": "New",
"publishedOn": "2024-12-05T15:49:37+00:00"
},
{
"lineColor": "yellow",
"impactRoadRisk": "Moderate",
"impactMaxCrashRisk": "Moderate",
"impactMaxDisruptionRisk": "Moderate",
"impactMaxRoadIndex": 5,
"impactStartPoint": "-89.617533 68.438459",
"impactEndPoint": "-89.626376 68.44377",
"impactRouteLine": null,
"impactLength": 0.62,
"impactSummary": [],
"custMsgId": null,
"impactMaxTippingIndex": 0,
"impactMaxWindGust": 20,
"impactMaxWindSpeed": 13,
"impactMaxPrecipitation": 0,
"impactMaxRainfall": 0,
"impactMaxSnowfall": 0,
"impactMaxRainAccumulation": 0,
"impactMaxSnowAccumulation": 0,
"impactMaxFreezingRainAccumulation": 0,
"impactMaxFloodIndex": 0.2,
"impactMaxHeatIndex": 39,
"impactMaxTemperature": 45,
"impactMinTemperature": 45,
"weatherAlerts": [],
"weatherGrids": [
{
"weatherGrid": {
"weatherGridId": 54608865,
"distanceToEvent": 0,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T11:57:20-07:00",
"roadIndex": 5,
"crashIndex": 5,
"disruptionIndex": 5,
"speedReduction": 0.05,
"windGust": 20,
"windSpeed": 13,
"totalPrecipitation": 0,
"totalRainfall": 0,
"totalSnowfall": 0,
"rainAccumulation": 0,
"snowAccumulation": 0,
"freezingRainAccumulation": 0,
"floodIndex": 0.2,
"tippingIndex": 0,
"visibility": 5,
"temperature": 45,
"heatIndex": 39
},
"startPoint": "-89.617533 68.438459",
"endPoint": "-89.626376 68.44377"
}
],
"publishState": "New",
"publishedOn": "2024-12-05T15:49:37+00:00"
},
{
"lineColor": "black",
"impactRoadRisk": "Critical",
"impactMaxCrashRisk": "Critical",
"impactMaxDisruptionRisk": "High",
"impactMaxRoadIndex": 9,
"impactStartPoint": "-89.62642 68.472136",
"impactEndPoint": "-89.569332 68.512041",
"impactRouteLine": null,
"impactLength": 4.43,
"impactSummary": [
"snow",
"rain",
"freezingRain",
"sleet",
"visibility",
"extremeWeather",
"dustStormWarning"
],
"custMsgId": null,
"impactMaxTippingIndex": 0,
"impactMaxWindGust": 50,
"impactMaxWindSpeed": 25,
"impactMaxPrecipitation": 0.5,
"impactMaxRainfall": 0.3,
"impactMaxSnowfall": 0.2,
"impactMaxRainAccumulation": 0.3,
"impactMaxSnowAccumulation": 0.2,
"impactMaxFreezingRainAccumulation": 0.2,
"impactMaxFloodIndex": 5,
"impactMaxHeatIndex": 65,
"impactMaxTemperature": 65,
"impactMinTemperature": 55,
"weatherAlerts": [
{
"id": "test",
"start_point": "-89.570595 68.50365",
"end_point": "-89.569332 68.512041"
}
],
"weatherGrids": [
{
"weatherGrid": {
"weatherGridId": 54613781,
"distanceToEvent": 0.81,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T13:06:14.4867898-07:00",
"roadIndex": 5.5,
"crashIndex": 4,
"disruptionIndex": 5,
"speedReduction": 0.2,
"windGust": 30,
"windSpeed": 15,
"totalPrecipitation": 0,
"totalRainfall": 0,
"totalSnowfall": 0,
"rainAccumulation": 0,
"snowAccumulation": 0,
"freezingRainAccumulation": 0,
"floodIndex": 0.2,
"tippingIndex": 0,
"visibility": 1,
"temperature": 55,
"heatIndex": 55
},
"startPoint": "-89.62642 68.472136",
"endPoint": "-89.575062 68.476818"
},
{
"weatherGrid": {
"weatherGridId": 54618697,
"distanceToEvent": 2.6,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T13:11:36.6243322-07:00",
"roadIndex": 7,
"crashIndex": 6,
"disruptionIndex": 6,
"speedReduction": 0.3,
"windGust": 40,
"windSpeed": 20,
"totalPrecipitation": 0,
"totalRainfall": 0,
"totalSnowfall": 0,
"rainAccumulation": 0,
"snowAccumulation": 0,
"freezingRainAccumulation": 0,
"floodIndex": 0.2,
"tippingIndex": 0,
"visibility": 0.5,
"temperature": 60,
"heatIndex": 60
},
"startPoint": "-89.575109 68.476795",
"endPoint": "-89.570593 68.503674"
},
{
"weatherGrid": {
"weatherGridId": 54623613,
"distanceToEvent": 4.67,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T13:17:47.2988961-07:00",
"roadIndex": 9,
"crashIndex": 8,
"disruptionIndex": 7,
"speedReduction": 0.5,
"windGust": 50,
"windSpeed": 25,
"totalPrecipitation": 0.5,
"totalRainfall": 0.3,
"totalSnowfall": 0.2,
"rainAccumulation": 0.3,
"snowAccumulation": 0.2,
"freezingRainAccumulation": 0.2,
"floodIndex": 5,
"tippingIndex": 0,
"visibility": 0.1,
"temperature": 65,
"heatIndex": 65
},
"startPoint": "-89.570595 68.50365",
"endPoint": "-89.569332 68.512041"
}
],
"publishState": "New",
"publishedOn": "2024-12-05T15:49:37+00:00"
},
{
"lineColor": "black",
"impactRoadRisk": "Critical",
"impactMaxCrashRisk": "Critical",
"impactMaxDisruptionRisk": "High",
"impactMaxRoadIndex": 9,
"impactStartPoint": "-89.569348 68.51204",
"impactEndPoint": "-89.584983 68.54773",
"impactRouteLine": null,
"impactLength": 2.73,
"impactSummary": [
"snow",
"rain",
"freezingRain",
"sleet",
"visibility",
"extremeWeather",
"dustStormWarning"
],
"custMsgId": null,
"impactMaxTippingIndex": 0.89,
"impactMaxWindGust": 50,
"impactMaxWindSpeed": 25,
"impactMaxPrecipitation": 0.5,
"impactMaxRainfall": 0.3,
"impactMaxSnowfall": 0.2,
"impactMaxRainAccumulation": 0.3,
"impactMaxSnowAccumulation": 0.2,
"impactMaxFreezingRainAccumulation": 0.2,
"impactMaxFloodIndex": 5,
"impactMaxHeatIndex": 70,
"impactMaxTemperature": 70,
"impactMinTemperature": 65,
"weatherAlerts": [
{
"id": "test",
"start_point": "-89.569348 68.51204",
"end_point": "-89.568007 68.530529"
}
],
"weatherGrids": [
{
"weatherGrid": {
"weatherGridId": 54623613,
"distanceToEvent": 0,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T14:19:32-07:00",
"roadIndex": 9,
"crashIndex": 8,
"disruptionIndex": 7,
"speedReduction": 0.5,
"windGust": 50,
"windSpeed": 25,
"totalPrecipitation": 0.5,
"totalRainfall": 0.3,
"totalSnowfall": 0.2,
"rainAccumulation": 0.3,
"snowAccumulation": 0.2,
"freezingRainAccumulation": 0.2,
"floodIndex": 5,
"tippingIndex": 0,
"visibility": 0.1,
"temperature": 65,
"heatIndex": 65
},
"startPoint": "-89.569348 68.51204",
"endPoint": "-89.568007 68.530529"
},
{
"weatherGrid": {
"weatherGridId": 54628529,
"distanceToEvent": 1.29,
"lastUpdateTime": "2024-12-05T10:00:00+00:00",
"estimatedImpactTime": "2024-12-05T14:23:24.1130895-07:00",
"roadIndex": 7,
"crashIndex": 6,
"disruptionIndex": 6.5,
"speedReduction": 0.4,
"windGust": 46,
"windSpeed": 3,
"totalPrecipitation": 0,
"totalRainfall": 0,
"totalSnowfall": 0,
"rainAccumulation": 0,
"snowAccumulation": 0,
"freezingRainAccumulation": 0,
"floodIndex": 0.2,
"tippingIndex": 0.89,
"visibility": 0.15,
"temperature": 70,
"heatIndex": 70
},
"startPoint": "-89.568022 68.530506",
"endPoint": "-89.584983 68.54773"
}
],
"publishState": "New",
"publishedOn": "2024-12-05T15:49:37+00:00"
}
],
"weatherAlertReferences": [
{
"id": "test",
"routeLine": null,
"url": "test",
"alertEvent": "Dust Storm Warning",
"title": "TEST - Dust Storm Warning issued January 2 at 4:25AM PST until January 2 at 12:00PM PST by NWS Spokane WA",
"urgency": "Expected",
"severity": "Moderate",
"certainty": "Likely",
"countryCode": "US",
"dispEffective": "2024-01-02T00:00:00Z",
"dispExpires": "3024-01-02T20:00:00Z",
"expired": false
}
],
"publishedOn": "2024-12-05T15:49:37+00:00"
}
}
]
}
Notification fields
Overview
These are summary fields for the weather notification.
Name | Type | Description | Sample Value |
---|---|---|---|
weatherNotificationId
|
string | The unique identifier of a weather notification. | 07eb5b1d-f9ce-49de-bf8b-52b5fa5a714b |
tripId
|
string | The unique identifier for a Trimble Maps Trip Management trip. | 183009256 |
publishedOn
|
dateTime | The date/time that the notification was retrieved. | 2023-11-24T17:53:58Z |
slowdownSummary
|
number | The slowdown summary is the overall percentage that the travel speed is reduced due to a weather-related impact. Example: Route duration is 100 minutes with a slowdownSummary of 0.1. This means 10% of 100 minutes, which equates to 10 minutes of additional delay.
| Range from 0.0 to 1.0 to signify 0 to 100% |
distanceUOM
|
string | Units of measure for distance. | Default is Miles. |
precipitationUOM
|
string | Units of measure for precipitation. | Default is Inches. |
temperatureUOM
|
string | Units of measure for temperature. | Default is Fahrenheit. |
weatherSummary
|
array | The weather summary contains any type of weather events that are expect to occur on the route. The events are only listed if they are “True” meaning they are expect to occur. | rain, snow, sleet,freezingRain, wind, visibility, extremeWeather, dustStormWarning |
custMsgRef
|
array | The custom message reference is an array of custom messages with an ID that can be used as a lookup for the custMsgId .
| 2345 |
Notification details
To provide hyperlocal weather information, the notifications service divides the U.S. into 3-kilometer-square grids. It retrieves predicted weather events, if any, for each grid that intersects with the planned route.
As a result, weather notifications include three JSON objects that provide increasing levels of granularity.
- The
riskSummary
object provides a high-level overview of how weather is expected to impact the entire route. - The
weatherImpact
object provides the location and details of a weather event. If multiple contiguous grids that intersect the route include the same level of road risk (Low, Moderate, High, etc.), they are grouped together as a singleweatherImpact
. - The
weatherGrids
object provides detailed information about each of the individual grids involved in a weather notification. It can be used to pinpoint the weather conditions at a specific location.
riskSummary
The Weather Risk Summary provides a high level overview of how weather is expected to impact the entire trip.
Name | Type | Description | Sample Value | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
maxRoadRisk
|
string | The highest amount of road risk the driver is expected to encounter on the route.
| Moderate | ||||||||||||||||||||||||||||||||||||||||
maxRoadIndex
|
number | The highest value of road risk on the route based on a 0 to 10 scale of severity. It is directly correlated to maxRoadRisk .
|
weatherImpact
The Weather Impact provides the location and details of a weather event.
Name | Type | Description | Sample Value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lineColor
|
string | Color value based on the road risk: Green, Yellow, Red, Black | Yellow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RoadRisk
|
string | The amount of risk recorded in a weather impact event: None, Low, Moderate, High, Extreme | Low | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
impactMaxRoadIndex
|
number | The index value of a weather impact event.
|
weatherGrids
Hyperlocal weather is provided by monitoring 3-kilometer square grids across the U.S. The weatherGrids
object provides detailed information about each of the individual grids involved in weather notifications. It can be used to pinpoint the weather conditions at a specific location.
Name | Type | Description | Sample Value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
routeLine
|
linestring | The full route linestring that passes through the grid. | LINESTRING (-85.376698 40.9453887663768, -85.37472166625525 40.95003) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
weatherGridId
|
integer | The Weather Optics grid ID. | 23452 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
distanceToEvent
|
integer | Distance in miles to the start of a grid. | 23.4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastUpdateTime
|
dateTime | The last time weather information for the grid was updated. | 2023-12-05T15:00:00+00:00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
estimatedImpactTime
|
dateTime | Estimated time the driver or asset will intersect with the grid weather event. | 2023-12-05T17:53:01.0586646+00:00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
roadRisk
|
string | The amount of risk recorded in the grid weather event: None, Low, Moderate, High, Extreme | Low | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
roadIndex
|
number | The index value of the grid weather event.
|
weatherAlerts issued by National Weather Service
Weather alerts are any alerts issued by the National Weather Service (NWS) that impact the route.
Name | Type | Description | Sample Value |
---|---|---|---|
id
|
string | The ID of the weather alert. | 600805f1-c94c-d70c-11c8-ddeec4fab0a0 |
routeLine
|
linestring | The full route linestring that passes through the alert. | “LINESTRING (-85.376698 40.9453887663768, -85.37472166625525 40.95003)” |
weatherAlertReferences
|
object | This object provides a full description of the NWS alert, identified by its id .
| See below |
"weatherAlertReferences": [
{
"id": "600805f1-c94c-d70c-11c8-ddeec4fab0a0",
"url": "https://alerts.weather.gov/example",
"alertEvent": "Flood Warning",
"title": "Flood Warning issued May 31 at 9:13PM CDT until June 04 at 3:34AM CDT by NWS",
"summary": "...FLOOD WARNING IN EFFECT UNTIL 915 AM CDT WEDNESDAY... * WHAT...Flooding caused by excessive rainfall is expected. * WHERE...A portion of South Central Kansas, including the following counties, Butler, Harvey, Kingman and Sedgwick. * WHEN...Until 915 AM CDT Wednesday. * RiskS...Flooding of rivers, creeks, streams, and other low-lying",
"urgency": "Expected",
"severity": "Moderate",
"certainty": "Likely",
"areaDesc": "Sedgwick",
"countryCode": "US",
"dispEffective": "2022-05-31T21:13:00-05:00",
"dispExpires": "2022-06-04T03:34:00-05:00",
"expired": true
}
]