Search code examples
here-apihere-fleet-telematics

HereAPI - Can't reach waypoints requested


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.


Solution

  • 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