Hands On

Getting Started with Speed Limits and Fleet Telematics

By Jayson DeLancey | 28 February 2019

Try HERE Maps

Create a free API key to build location-aware apps and services.

Get Started

Navigating from Point A to Point B is one of the most common use cases we see in location services. If you’ve ever felt like the travel time estimate was wrong you might wonder why. One reason is that we don’t all drive the same way. Since estimates returned from navigation services are best guesses based on traffic conditions and average speeds it may not match your expectations. If you want an app that provides more accurate results, the custom speed profiles in the HERE Fleet Telematics REST API might help.

I’m going to take a look at what Fleet Telematics is to demonstrate how to use the REST endpoint with curl and get back results based on a custom speed profile.


What is Fleet Telematics

What does the name Fleet Telematics mean? The first part of the name comes from Fleet, meaning a group of motor vehicles owned or leased by an organization rather than an individual. The typical examples of this are things like car rental companies, taxicabs, public utility vehicles, buses, delivery trucks, police and rescue vehicles, etc. The second part of the name Telematics is derived from the French telematique, a blended word of telecommunications and informatique (computer science). From the blog post Our Platform Extensions Are Getting a Makeover you learned a bit about why the Fleet Telematics API can be useful when your use case gets more advanced than the Routing API alone.

Let’s start with the basics.

Routing API

The Routing API is perfect for quickly finding the route between two waypoints for most cases. Let’s look at an example navigating from Alamo Drafthouse Cinema in Austin, TX to The Alamo in San Antonio, TX.

I setup a short script like the following (for Linux / OSX) which initializes my APP ID and APP CODE into my environment. You can find these values from the Projects dashboard:


export ROUTING_API_HERE='https://route.api.here.com/routing/7.2'
export FLEET_URI_HERE='https://fleet.api.here.com/2/'

Then I can use curl and jq to pretty print the resulting JSON response and run some experiments:


curl \
  -X GET \
  -H 'Content-Type: *' \
  --get "$ROUTING_API_HERE/calculateroute.json" \
    --data-urlencode "app_id=$APP_ID_HERE" \
    --data-urlencode "app_code=$APP_CODE_HERE" \
    --data-urlencode 'waypoint0=geo!30.298363,-97.704712' \
    --data-urlencode 'waypoint1=geo!29.42561,-98.48653' \
    --data-urlencode 'mode=fastest;car;traffic:enabled' \
    --data-urlencode 'legattributes=li' \
| jq '.'

The route from theater to museum is 131,419 meters (81 miles) with a travel time of 5,233 seconds (1 hour, 27 minutes).  This CalculateRouteResponseType as pictured below includes a set of instructions (or maneuvers) we can use from the response.


I also included the legattributes=li which will include the RouteLinkAttributeType in the response. These links include the speed limit details that can be useful.

"maneuver": [
    "position": {
      "latitude": 30.298262,
      "longitude": -97.7047813
    "instruction": "Head toward <span class=\"toward_street\">Aldrich St</span> on <span class=\"street\">McBee St</span>. <span class=\"distance-description\">Go for <span class=\"length\">30 m</span>.</span>",
    "travelTime": 12,
    "length": 30,
    "id": "M1",
    "_type": "PrivateTransportManeuverType"
  "link": [
    "linkId": "+1217666399",
    "shape": [
    "speedLimit": 20,
    "_type": "PrivateTransportLinkType"

In the article Speed Limit Fragment for Android SDK, Mariusz taught us how to retrieve SpeedLimitFragments with the Android SDK. It’ll take a little bit of work to parse the JSON response from Routing API and REST alone to associate the speed limit of the link for each road segment maneuver.

Fleet Telematics API

There are a lot of parameters you can use to calculate a route with the Routing API but there are some limitations for more advanced use cases. The Fleet Telematics API helps with the scenarios through its own calculateroute resource to do things like:

  • Define custom speed profiles for any FC class road in the HERE road network to calculate more appropriate ETAs
  • Calculate routes considering driver rest times for any type of routes (eg, with/without waypoints, custom routes)
  • Calculate routes based on desired arrival time and day to a destination while considering real-time or historical traffic
  • Calculate fuel-/energy-optimized routes considering road conditions like uphill and downhill
  • Calculate cost-optimized routes considering toll-cost information for various vehicle profiles

It’s this first use case I’m going to look at a bit more.

Speed Limits

A bit of background about speed limits. In January 1974, the United States passed the Emergency Highway Energy Conservation Act that prohibited drivers from exceeding 55 miles per hour (90 km/h) on any roadway. The rationale for the law was fuel efficiency during the oil crisis and price spikes of the time.

The National Motorists Association advocated for its repeal and was successful in 1995. The NMA position on speed limits is that they should be set according to the 85th percentile of free flowing traffic. The theory is that most drivers are rational so a “realistic” speed limit is one in which no more than 15% of the public exceeds through reasonable compliance. The Institute of Travel Engineers explains that “a speed study usually creates a speed distribution” for a segment of road and the speed can be set +/- 5mph of the 85th percentile unless engineering or other specific road conditions deem it unsafe.

A Federal Highway Administration (FHA) study of nearly 200 roads in 22 states determined that 55% of traffic exceeded the posted speed limit. Even after speed limits were raised or lowered as much as 20mph, there was not much variation in speed and no significant changes in crashes.

I’m going to see what happens when increasing the speed profile for this route.

Custom Speed Profile

If you take a look at the Fleet Telematics https://developer.here.com/documentation/fleet-telematics/dev_guide/index.html you can view the Routing & Route Matching specification. The request is pretty similar to the routing API but the URI differs and you must provide a vehiclecost or drivercost.


curl \
  -X GET \
  -H 'Content-Type: *' \
  --get "$FLEET_URI_HERE/calculateroute.json" \
    --data-urlencode "app_id=$APP_ID_HERE" \
    --data-urlencode "app_code=$APP_CODE_HERE" \
    --data-urlencode 'waypoint0=30.2983,-97.7047' \
    --data-urlencode 'waypoint1=29.4256,-98.6507' \
    --data-urlencode 'mode=fastest;car;traffic:enabled' \
    --data-urlencode 'vehicle_cost=1' \
| jq '.'

I get back additional results from this query, including the links without requiring an extra parameter. To change the speed profile though I’m focusing on one parameter in particular: speedFcCat.


Comma separated list of speeds driven per road functional class and speed category. Can contain empty entries (don’t change). Overrides router’s default driven speed values.

The Geocoder API Speed Category is a useful reference to understand. The following example is to illustrate various speed categories that match up with the functional class of road. You can find the functional class from the link details:

"link": [
    "linkId": "990240352",
    "length": 22,
    "remainDistance": 144736,
    "remainTime": 6386,
    "shape": [
    "functionalClass": 5

You can use one of the default speed tables for car, truck, 7.5 ton truck, 18 ton truck or give your own arbitrary speeds in kph. The trick is that you must provide something for each speed category and functional class. If you don’t specify a value the default will be used, but you still need the delimiter.


For example, TX-130 has a speed limit of 85mph and is the fastest posted highway in the United States so the request might include a parameter like this modifying the first four speed categories and leaving the remaining four the defaults.

    --data-urlencode 'speedFcCat=137,129,121,105,,,,;137,129,121,105,,,,;137,129,121,105,,,,;137,129,121,105,,,,;137,129,121,105,,,,;137,129,121,105,,,,' \

As might be expected, driving faster will reduce the total travel time in the response.

Wrapping Up

Custom speed profiles are only one way of getting started with the functionality available from the Fleet Telematics API. There are plenty of other projects involving truck routing, custom locations, geofencing, and more that can help build solutions by adjusting some of the parameters. Let us know how you are using it in the comments, but until then please drive safely and follow posted speed limits.