With echoes of "Are we there yet?" Routing Services are easy to relate to
because we use them to get driving directions from point A to point B. I'm
going to take a look at a few uses to help navigate your application from Google Routes to HERE Routing.
Let's say we're starting at 187 W 9th St. Boston, MA and heading to Gillette Stadium and need to get a simple route by making a REST service call. You can start by switching the GET request to the following endpoint:
The HERE services are typically version controlled so that you can decide when to upgrade or downgrade based on what behavior you are expecting and a time/place of your choosing. You'll need to substitute the Google api key with the HERE
app_code as you may have seen in other tutorials.
With the endpoint and authorization out of the way, we specify the parameters for the route we want. The Google Directions API to its credit accepts some flexible input parameters for
destination which can be an address doing the geolocation behind the scenes. If you use it this way and are migrating to HERE you'll need to make the geocoding request first to identify the latitude and longitude. You can learn more about that in How-To Migrate from Google Places to HERE Geocoder.
The HERE route API also requires a
mode that specifies any constraints around the type of route you want returned. You can find Transport Mode described in the documentation for the full range of options.
After updating your requests, you'll need to find the data of interest for your application in the response.
Let's say you are interested in a trip summary. This may include the distance and duration. You'll find them in the corresponding:
This same request of the HERE Routing services returns additional information you may find valuable in your application such as the
flags indicating features of the route.
The driving directions for steps along the route can be found with:
This is an example step from the driving plan, where the leg identifies a
end, and a list to include each