HERE iOS SDK Developer's Guide

Truck Routing

The Truck Routing feature in the HERE SDK allows users to calculate routes that can be specifically travelled by trucks and commercial vehicles. Commercial vehicles typically have different regulations for their transportation routes. For example, a government may have laws that restrict trucks carrying flammable materials from traveling in a residential area. By using the Truck Routing feature, you can launch a route calculation that specifically adheres to these restrictions.

Truck Routing and the NMARoutingMode class

The NMARoutingMode class contains truck-specific properties that you should set to perform a route calculation. You need to set the the route transportation mode to NMATransportModeTruck, and then optionally set the following route properties before launching the calculation:
  • The number of truck trailers
  • The truck height
  • The truck length
  • The truck width
  • The maximum allowed truck weight
  • The category of tunnels that the truck cannot travel on
  • The truck's weight per axle
  • Hazardous goods that are transported by the truck
Note: Truck routing only supports NMARoutingTypeFastest. Other routing types are not supported.

A Route Calculation Example

  1. As with the previous routing example, create the NMACoreRouter, then create an NSArray and set its waypoints.
  2. Initialize NMARoutingMode and set the transport mode to NMATransportModeTruck.
    NMARoutingMode* routingMode = [[NMARoutingMode alloc] initWithRoutingType:NMARoutingTypeFastest transportMode:NMATransportModeTruck routingOptions:0];
    
  3. Set other truck routing properties.
    routingMode.vehicleLength = 25.25f;
    routingMode.vehicleHeight = 2.6f;
    routingMode.trailersCount = 1;
    
  4. Calculate the route by calling calculateRouteWithStops:routingMode:completionBlock:.
    [coreRouter calculateRouteWithStops:stops routingMode:routingMode
        completionBlock:^(NMARouteResult *routeResult, NMARoutingError error) {
          // If the route was calculated successfully
          if (!error && routeResult && routeResult.routes.count > 0)
          {
            NMARoute* route = [routes objectAtIndex:0];
            // Render the route on the map
            mapRoute = [NMAMapRoute mapRouteWithRoute:route];
            [mapView addMapObject:mapRoute];
          }
          else if(error)
          {
            // Display a message indicating route calculation failure
          }
        }];
    

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.