navigationmapshere-apinokiahere-maps-rest

Backend Calculated Route,Here-API to just show Guidance and route on Map


I have a back-end service where the route calculation is done and I will be using here-api to display the calculated route on map and start guidance, Can I know the API which can be used for this purpose ?

I have gone through, Here-API where I see

  1. We can create an Route from RouteResult on Overridden onCalculateRouteFinished() function.

  2. From the list we can get Route data and create a MapObject.

  3. Using this MapObject add this to the Map.

But this is not my intention as I will not be having Route data at all.

Which Here-api to call with Geo-Coordinates to display the route b/w them in the map.


Solution

  • In general it is not possible to transfer a route from a back end server (using HERE Routing API) to the HERE Mobile SDK. A workaround solution would be :

    1. Retrieve the shape of the route from HERE Routing API.
    2. Simplify this shape to reduce the number of coordinates. There can be different possibilities here, for e.g use only start,middle,end coordinates of maneuvers instead of the whole maneuver shape )
    3. Pass the Simplified shape to you app
    4. In the app , reconstruct the route using HERE Mobile SDK function CoreRouter.

      calculateRoute(java.util.List<GeoCoordinate> routePoints, RouteOptions routeOptions, Router.Listener<java.util.List<RouteResult>,RoutingError> listener) 
      
    5. Use the route from the call back for Navigation use case.