I'm using a following request to calculate a driving route. What is the correct syntax for specifying the transit radius? For some reason the transit radius isn't honoured for the intermediate waypoint (waypoint1) while working correctly for the final waypoint.
https://route.api.here.com/routing/7.2/calculateroute.json?app_id={appId&app_code={appCode}&waypoint0=geo!50.035035,19.925015;1500&waypoint1=geo!50.06684315082262,19.923276861182046;1500&waypoint2=geo!50.07842990411413,20.032238457351923;1500&mode=fastest;car;traffic:enabled&arrival=2020-05-29T17:27:42.000Z&routeAttributes=shape
I've done an experiment comparison with and without requesting a transfer radius. It seems to be honoured for start and endpoints only.
I sent the same request using the routing v7 and authenticated with the APIKEY and I am not getting a loop, but the route leaves the highway, to access the park gate and then comes back onto the highway. I am not able to recreate the loop that you are getting.
Call used
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?xnlp=CL_JSMv3.1.16.1&apikey=&waypoint0=50.035035%2C19.925015%3B1500&waypoint1=50.06684315082262%2C19.923276861182046&waypoint2=50.07842990411413%2C20.032238457351923%3B1500&mode=fastest%3Bcar%3Btraffic%3Aenabled&arrival=2020-05-29T17%3A27%3A42.000Z&routeAttributes=shape&representation=display
Related
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
I am trying to execute a rather simple request using Here FleetApi Demo, this is the request I am trying to do:
https://fleet.api.here.com/2/calculateroute.json?waypoint0=19.3411164,-99.2533428&waypoint1=19.415757,-99.177453&waypoint2=19.344366,-99.251718&mode=fastest;car;traffic:disabled&departure=2021-09-21T11:05:44&alternatives=0&weightPerAxle=0.87t&limitedWeight=1.739t&height=1.67m&width=1.8m&length=4.41m
But this error is returned:
Couldn't reach way point 1 (start links -703403377 703403377 dest links -895284559 895284559 ), closest link to destination reached: 1291258613 at 19.34133/-99.25233, issues: gate
This request has a similar situation on waypoint 2 but this returns the following issue:
Couldn't reach way point 2 (start links 895284559 dest links -832770028 832770028 ), closest link to destination reached: -1077091646 at 19.34552/-99.25272, issues: one way
In both situations, it is possible to travel these routes but Here is unable to calculate it. The only way to do so is by adding a radius to search for the waypoint but that returns wrong routing:
In this example, waypoint blue is the desired waypoint but waypoint green is returned which is not acceptable solution.
Is there a workaround to these issues or am I doing something wrong?
We use Google Maps Directions API to retrieve lat,lon of waypoints.
When you throw the request into demo tool https://tcs.ext.here.com/examples/v3/fleet_telematics_api (expert mode). It will show the error and a red flag at the nearest reached point. Then you see that this is a industrial area or leisure park or similar. The fleet telematics APIs applies various vehicle restrictions and gate restrictions while calculating the route.
If you want to ignore those restrictions you have to set &ignoreWaypointVehicleRestriction=100000 and &traverseGates=true in the request query. Then ,it will ignore the VehicleRestriction and allows the router to traverse all gates.
Sample Request.
https://fleet.api.here.com/2/calculateroute.json?waypoint0=19.3411164,-99.2533428&waypoint1=19.415757,-99.177453&waypoint2=19.344366,-99.251718&mode=fastest;car;traffic:disabled&departure=2021-09-21T11:05:44&alternatives=0&weightPerAxle=0.87t&limitedWeight=1.739t&height=1.67m&width=1.8m&length=4.41m&&ignoreWaypointVehicleRestriction=800000&traverseGates=true
For more details regarding &ignoreWaypointVehicleRestriction=100000 and &traverseGates=true flags ,please refer below API document.
https://developer.here.com/documentation/fleet-telematics/api-reference.html#tag%2FRouting-Extensions-&-Route-Matching%252Fpaths%252F~1v8~1calculateroute.json%252Fget
When using Fleet Telematics API I have been getting the error message quite often -- about 10% of the routes I want to calculate: "Couldn't reach way point 1 (start links 781909352 -781909352 dest links 881144574 -881144574 881144579 -881144579 ), link 881144574's through traffic restriction might apply, link 881144579's through traffic restriction might apply"
Sample query: http://fleet.api.here.com/2/calculateroute.json?mode=fastest;truck;traffic:disabled&driver_cost=20¤cy=EUR&rollups=total,country,tollsys,country;tollsys&commercial=1&shippedHazardousGoods=0&waypoint0=52.51,13.42&waypoint1=45.747353, 11.733903&tollVehicleType=3&vehicle_cost=0.5&fuelType=Diesel&emissionType=6&length=1500cm&height=270cm&heightAbove1stAxle=120cm&vehicleWeight=7000kg&vehicleNumberAxles=2&trailerType=2&trailersCount=1&trailerNumberAxles=4&trailerHeight=270cm
What are these numbers after the word "links"? Do they give more information about what the restriction might be? And if so, how do I access that information?
When I manually adjust the waypoint latitude and longitude a bit to move it to a nearby bigger road, a route is able to be found. But for me this needs to be automated to work. If I could increase the radius around the waypoint that would be considered a "success" to find a route, that would solve my problem.
The numbers after the word "links' are link IDs with the - indicating an opposite direction of travel. The error means the algorithm cannot get a valid route that goes through those two waypoints without violating the restrictions that you have provided (as parameters). You can add a routeMatch parameter with value 1 so the algorithm will treat you waypoints as GPS trace and find the most probable trace along the route.
It seems that the Routing API requires a Lat/Lon pair to be supplied to the Waypoint parameter. I've seen other APIs that allow for the actual address to be passed, instead of the Lat/Lon. I'm wondering if anyone knows of a way to do this with the Here.com API. In many instances I can obtain the Lat/Lon first, but in one instance it's proving to be a headache, especially given the nature of the way that the REST APIs work and the fact that I'm trying to batch-process a small group of addresses at a single time. Any help would be appreciated.
Unfortunately Routing API needs a waypoint in lat, lon and required a Geocoding as a pre-requisite.
Maybe a not so nice workaround if you are facing issues with Geocoding, the Duck Duck Go provides a syntax
https://duckduckgo.com/?q=!here Junghofstraße 14,60311 Frankfurt am Main,Germany, Germany&ia=about
But you will stll have to extract the lat,lon from the final redirected url.
When generating a route using the HERE API, I would like to force the route to travel down a certain side of the street. For example, there may be a pickup point on the westbound side of the 2-way street. A U-turn is not possible, thus, I need to ensure the route travels westbound through the waypoint and not eastbound. Is this possible?
Please check the Waypoint Parameter "passThrough":
http://developer.here.com/rest-apis/documentation/routing/topics/resource-param-type-waypoint.html