HERE Routing issues with TRUCK setting - here-api

We are building mobile application for truck navigation. When using HERE SDK route calculation for trucks, it sometimes tries to avoid a particular road segment, that is in reality suitable for trucks.
One example - highway crossing:
When I calculate route for car, route is correct and meaningful, it follows the highway from south to the north and crosses under the east-western highway. We expect the same route also for a truck as trucks drive like this daily basis (legally).
But when we actually calculate route for truck, it makes a massive detour and takes us either to the westbound highway (blue route on the picture) or eastbound highway, where it turns back after several kilometers and comes back (green route on the picture), both of which is a nonsense. It seems as HERE wants to avoid going under the highway bridge.
I tried to put a waypoint slightly north of the east-western highway and suddenly even with truck setting the route is calculated correctly and does no longer want to avoid going under the bridge. So it seems HERE knows it is legal to go there, but tries to avoid this particular road segment at all costs. We witnessed such behavior multiple times at different places.
This is the exact setup:
Start: 49.154356, 16.600705
Destination: 49.190870, 16.594660
Traffic is disabled for route calculation
For tta time we use getTtaExcludingTraffic()
Truck dimensions were tested both with zero size and and with very small values, so that it certainly fits under the bridge
Question is what causes this behavior? It is a problem of HERE's data? Can we avoid such detours in our application?

Seems like this is more so data error, please use
Map creator (locate the poi and make the change, Here team will review and approve it)
Use Map Feedback API : https://developer.here.com/documentation/examples/rest/map_feedback/no-trucks-allowed-on-road

Related

Matrix routing with destinations close to motorways

I have a number of locations between which I want to know the travel time and distance.
The locations have been correctly geocoded. However, the problem I am experiencing is that some of the locations lie between a regular road and a motorway. In fact, they lie closest to the motorway.
In this case, the travel time and distance I receive consider the location to lie on the motorway (the closest road), which leads to an incorrect estimation of the actual travel time and distance.
Given that I cannot manually adapt each geocode to lie closest to the regular road, I need a different solution.
I included 'street!!' in my call as indicated on https://developer.here.com/api-explorer/rest/routing/route-to-location-near-motorway but to no avail.
My call looks like this "https://matrix.route.api.here.com/routing/7.2/calculatematrix.json?start0=x.x,y.y&destination0=street!!x1.x1,y1.y1&mode=fastest;car;traffic:disabled&summaryattributes=traveltime,distance&app_id=...&app_code=...".
Is there another way to avoid that Here puts the destination on the motorway?
Your help would be greatly appreciated. Thank you in advance!
Below you find one example
Geocodes of departure: 51.090995,4.018793
Geocodes of destination: 51.017960,3.694040 (close to E40/A10 in Belgium)
When I use the matrix routing API, I get a distance of 29799 meters and a travel time of 1317 seconds.
My call:
"https://matrix.route.api.here.com/routing/7.2/calculatematrix.json?start0=51.090995,4.018793&destination0=street!!51.017960,3.694040&mode=fastest;car;traffic:disabled&summaryattributes=traveltime,distance&app_id=...&app_code=..."
When I use the routing API to get the directions, I can see that my destination is updated to 51.0187054,3.6935735, which is on the E40/A10. This gives me a distance of 29827 meters and a travel time of 1335 seconds.
I used the call below:
"https://route.api.here.com/routing/7.2/calculateroute.json?app_id=...&app_code=...&waypoint0=51.090995,4.018793&waypoint1=street!!51.017960,3.694040&mode=fastest;car;traffic:disabled"
Given that the distance and travel time differs, I executed my matrix routing API call again with the updated destination geocodes (51.0187054,3.6935735). This provided me with the same distance and travel time as my initial matrix routing request, i.e. 29799 meters and 1317 seconds.
I used this call:
"https://matrix.route.api.here.com/routing/7.2/calculatematrix.json?start0=51.090995,4.018793&destination0=street!!51.0187054,3.6935735&mode=fastest;car;traffic:disabled&summaryattributes=traveltime,distance&app_id=...&app_code=..."
As such, I am sure the destination is on the E40/A10. How can I avoid this?
On a related note, why do the travel time and distance differ between the matrix routing API and the routing API?
When I enter the geocodes in GoogleMaps, I actually get the position I wanted.
As you can see, it is not on the E40. Why can't I get a route to the nearest regular street?
So taking the example you gave, the destination waypoint 51.017960,3.694040 lies very close if not on the E40/A10 itself. See image below:
Moreover, using our reverse geocoder API to get the list of address within 200m radius of the destination waypoint returns only addresses (points) along the E40, 9052 Gent, België with street match level . There is therefore no way for the algorithm to know which nearby street you intend to arrive when the waypoint is many hundreds of metres off. I will suggest to correct your waypoints using our reverse geocoder api to determine which waypoints are way off your intended address.

Triggering point to TBT Info in HereMaps Voice Guidance

From here maps Voice Guidance ,Exactly When Google TSS will speak about Maneuver Take left into X road ,Now take Right, like that.
Consider Navigation Distance 10km ,when trip started there is Turn left in 500m meters ,so when Google TTS will speak?before 300m or 200m ?
I want to know the triggering point to speak for My task to complete.
--suppose speaking Text is long(eg:Now keep right and then turn slightly right onto JC Road) Speaking logic distance will also change?
--Apart from TBT(Turn By Turn Info) here maps also triggering in middle to speak like ( After 250 meters keep left towards Hosur Road ) how this is calculating
So many questions is single please excuse me
Interface for notifying NavigationManager.AudioPlayer functions used by NavigationManager. Clients can take over playback of audio files and TTS text strings by implementing this interface and submitting to NavigationManager.AudioPlayer.setDelegate
The audio will be played during the entire route, playing the audio based on distance calculation logic can not be done.

Clarification required in classification of transport modes

I am using calculate route in routing api to identify distance and time from source to destination. In developers documents I have seen one of the transport mode as car HOV. What kind of vehicals exactly comes under this category.
Like when I say truck it covers multiple types of vehicals like. Caravan , camper e.t.c. In the same way what comes under car HOV category.
Please find below the definition provided for carHOV in Here documentation (developer.here.com/documentation/routing/topics/transport-modes.html)
carHOV: same as routing for cars, but also allows usage of HOV (high-occupancy vehicle) lanes and roads.
HOV stands for High-occupancy vehicle lane. A high-occupancy vehicle lane (also known as an HOV lane, carpool lane, diamond lane, 2+ lane, and transit lane or T2 or T3 lanes) is a restricted traffic lane reserved for the exclusive use of vehicles with a driver and one or more passengers, including carpools, vanpools, and transit buses. These restrictions may be only imposed during at peak travel times or may apply at all times. The normal minimum occupancy level is 2 or 3 occupants.
YOu can read more about HOV in Wikipedia https://en.wikipedia.org/wiki/High-occupancy_vehicle_lane.
In addition there are some rules that mark certain vehicles as equivalent to HOV.
These are defined in map specification and not exposed to routing request / response. Example:
Toll is same as HOV
Motorcycle/Hybrid/Alternative Fuel... is same as HOV
Thus if you are calculating route / travel time you may get status code that route is violating HOV rule (since you didn't specify transport type). In real life it may mean that road is open to carpool or people with "EasyPass" (or equivalent toll system).
An example would be I-66 in VA inside Capital Beltway (USA).

Handle traffic in 2D city builder

I´m creating a 2D isometric city building simulation and today I have kind of a "best practice" question without asking for specific code.
As in all city building games you are able to place building, roads and so on. The player is able to place building everywhere, no matter if it´s connected to a road or not. In addition to that there is one building (call it center building) all the buildings need to be connected with (by road).
I need to handle that without doing too many calculations which, breaks the FPS.
Right now I have a timer job for each building which checks if one of the surrounded tiles of a building is a road. That works fine, also for a lot of buildings since the check is simple.
But now I would like to check the connection to the center building. To check that it is necessary (in my opinion) to use something like a pathfinder, which checks if one of the surrounded tiles has a road connection to one of the surrounded tiles of the center building.
I can not check that frequently because this completely smashes the FPS down to 30 or lower. My idea was to fire an event if a road has been built or destroyed to "recalulate" the road connection. But there comes another problem...the player might destoy a road in the middle of the map and the buildings are really far away from each other so I need to find the involved buildings which also might take too much time.
My last idea is creating something like a timer queue and work through these items gradually, but before I keep using the trial and error method I would like to ask you for ideas.
Really looking forward to your ideas!
Yheeky
You could have each building store a list of tiles (a path) that connects it to the center building. Then when a tile is randomly destroyed by the player, you can have each building tested to see if it pathed through that road tile or not.
Alternatively you could have each road tile store which buildings require it, so when the tile is destroyed you have the buildings immediately throw flags. This could get quite messy though, but lends itself decently to background speed cleanup calls.
Both methods are quite messy. Perhaps you can make it a rule that the player can't place roads except next to other roads or next to the center building. Then when the player deletes a road tile, do a paint-style fill that destroys all of the disconnected roads. You can also periodically do a random check on tiles to see if they are illegally placed or not, but that should be unnecessary if you're careful.

Altitude in a tunnel or on a bridge

In my web application, I need to know the altitude of a road. For that, I use the Google Maps API v3. I use the Direction Service for getting the waypoints and then I use the Elevation Service to get the altitude of each points that the Direction Service has returned.
The problem is, if there's a tunnel or a bridge, the elevation will returns the altitude of the mountain (for a tunnel) or under the bridge...
Is there any way to get the good altitude of the road who goes inside a tunnel or on a bridge ?
I'm open for any suggestion.
Thank you
The data you need could be found in Map Maker Road Attributes (is maintained by the community)
Unfortunately there is no API for it on V3
The "good altitude" only can be obtained with a good GPS or another hardware designed for that. A good enough value could be calculated if you somehow store the places where tall bridges are (or deep tunels), and then for those places retrieve the corrected altitude (not an easy task, but if your scope isn't too big and the data is already on Google's Map Marker it could work).

Resources