About routing between multiple locations with truck - here-api

I have the following content in the link (https://www.developer.here.com/documentation/android-premium/dev_guide/topics/routing.html):
You can use RouteWaypoint to add more waypoint details to your route calculations. These details include whether the waypoint is a deliberate stopover or a crossing point through which the route must pass. This affects routing because the path containing the stopover or route may be different. For example, the calculated route may suggest a U-turn maneuver after a stopover, while a route containing the same location as the waypoint is recommended to continue on the same street. The via waypoint type is only supported in car routes and is not supported in other route types.
I guess this passage means that your company's SDK supports path planning between multiple points, but it seems to only support the "car" type. I want to confirm if the truck type is supported.

Adding multiple waypoints for Trucks is supported, but waypoints will always be of type "Stop_Over" , you cannot have a waypoint as type "Via_point" when using Truck Routing. More details can be found in https://www.developer.here.com/documentation/android-premium/api_reference_java/com/here/android/mpa/routing/RouteWaypoint.Type.html
VIA_WAYPOINT
public static final RouteWaypoint.Type VIA_WAYPOINT
No maneuver is generated for a VIA waypoint. After the VIA waypoint, route will continue in the same direction as when it's approached.
Via waypoints will "force" the route to pass through them, but they will not cause any guidance, announcement or maneuvers.
VIA waypoints are not considered during Guidance triggered re-routing nor do they trigger any callbacks upon arrival at the waypoint.
This is only supported by RouteOptions.TransportMode.CAR . It's ignored for other transport modes.

Related

Get Polyline with the Here Tour Planning API

We're using the Tour Planning API because it seems to be the only routing API that supports time windows, however according to the documentation the Tour Planning API does not return the route polyline.
Is there another way to get the route polyline along with the ordered stops?
Here Tour Planning and HERE routing are based on the same data; therefore, the tours returned are realistic. In the tour results, the sequence of stops also includes breaks if there are. While requesting the routes from routing API, use all the stops as waypoints (via) with duration at that stop (stopDuration). The resulting route should closely match the tour plan. Depending on the current traffic situation or other factors, there can be a minor difference.
Learn more about waypoint routing here: https://developer.here.com/documentation/routing-api/dev_guide/topics/waypoint.html
An example of routing request with waypoints and stopDuration looks like this: https://router.hereapi.com/v8/routes?routingMode=fast&transportMode=car&return=polyline,summary&departureTime=2022-08-01T08:00:00&origin=52.530914,13.384966;radius=100&via=52.525331,13.369311;radius=100!stopDuration=360&via=52.503011,13.341190;radius=100!stopDuration=1200&destination=52.530914,13.384966;radius=100

HERE Maps - truck restrictions

I'm using the Here API to calculate routes for trucks with 40t. Using the HERE devtools, i got the same error of my APP. The answer is "The API can't calculate the route because of illegal access". I checked the map (image attached) and in the street where my journey will start, with a difference of some meters, it exists two limitations 12t and 18t. The street is one way... If you see the satellite image exists several trucks... The company is testing the software says the trucks goes their...
Can some help me on this?
https://fleet.api.here.com/2/calculateroute.json?waypoint0=41.325299,2.141551&waypoint1=stopOver,3600!41.3291843,2.0317197&waypoint2=stopOver,3600!40.91260530,-8.42291420&waypoint3=38.855951,-9.104382&mode=fastest;truck;traffic:enabled&departure=2020-08-19T02:57:58&alternatives=0&weightPerAxle=14t&limitedWeight=40t&height=4m&width=2.55m&length=16.5m&trailersCount=
If you want to ignore the restrictions for trucks in the route, add the parameter truckRestrictionPenalty and set the value to soft.
The route violating truck restrictions is indicated in the response with dedicated route and manoeuvre notes. The route with the note of the type violation and the text truckRestriction may be travelled at your own responsibility. While driving on such a route, extra care has to be taken as it may result in a vehicle or road infrastructure damage.
You can read more about the parameter here.
Thanks for your feedback, but we are using the Fleet Telematics Api not the Routing API. Using your info, We researched a litle more and we found the equivalent parameter: ignoreWaypointVehicleRestriction.
We added these params &ignoreWaypointVehicleRestriction=5000;0;all and the API returned the route with the warning.
Thanks,

how to search a segmented route?

im implementing HERE route search in my app, i have at most 9 destinations as stops along the route, my problem is that in these routes could be vehicle change (like, car to plane), of course, in those case i donĀ“t expect to have a route, but for performance reasons and to avoid sending 10 route request, im sending all the waypoints, even the unneeded, the problem in this case is of there is a section of all the route with no route found, then i get a WebExcepion with no response. There is any option i could enable to get the legs with maneuvers when there is one, and a error in the legs without route? i want to avoid sending several requests for each route.
waypoints, legs, summary are the default attributes for a route. this can't be disable even if there is no route between the two waypoints. However the response can be optimised for legs attributes, which is not needed in your case. this needs to be handled during rendering at UI side to avoid displaying route if there isn't any route,

Deeplinking complex route in Here WeGo

For our use case, we need a turn-by-turn navigation on a mobile device but using a custom route.
Please let me know if the following usage scenario is possible:
Given an array of points (lat/long) that the route needs to pass through, get a route using CalculateRoute.
Create a deeplink for HERE WeGo (e.g. iOS) using the sequence of waypoints obtained in step #1
Navigate turn by turn in HERE WeGo along the route
So far I was successful in #1 but could not create a deeplink with the same route for HERE WeGo. When I create a link, the app simplifies the route to only include origin and destination points and omits all "via" points.
Would appreciate advice on this.
In general passing the waypoints one after the other should open the route with the intermediate points (at least on wego.here.com) , not so sure if this work out of the box in HERE WE Go https://developer.here.com/documentation/deeplink-web/dev_guide/topics/share-route.html

Here API Routing - Avoid unpaved roads

can anyone write how to avoid unpaved roads in Here routing (or truck routing) in REST API? I have checked API and I couldn't find answer. Routing API routes cars or trucks via dirty roads, what is unaccepted.
RouteFeatureType:The routing features can be used to define special conditions on the calculated route. The user can weight each feature with non-positive weights.
Possible paramers are: tollroad, motorway, boatFerry, railFerry, tunnel, dirtRoad,
park.
The Feature weights are used to define weighted conditions on special route features like tollroad,
motorways, etc.
-3 strictExclude The routing engine guarantees that the route does not contain strictly
excluded features. If the condition cannot be fulfilled no route is returned.
-2 softExclude The routing engine does not consider links containing the corresponding
feature. If no route can be found because of these limitations the condition is weakened.
-1 avoid The routing engine assigns penalties for links containing the corresponding
feature.
0 normal The routing engine does not alter the ranking of links containing the
corresponding feature.
Of course does the map content play also a huge role here. It is needed for the routing that the attribution e.g. for a dirt road (unpaved road segment) is set correctly.
You can also check details and report issues here: https://mapcreator.here.com

Resources