I have a problem with Here Maps Routing API v8.
Altough the documentation states that:
but a request may specify many more intermediate waypoints with via as well. See Route Via Intermediate Waypoint for examples.
... I am at a loss how to create a request with one origin/destination and two or more waypoints. In v7 we had a single waypoints parameter which allowed unlimited waypoints.
In v8, I tried something like: &via=52,13;51,14&.. to send two via points, but that doesn't work.
The v8 documentation (which feel rushed/unfinished) doesn't help, and neither their only example, which only illustrates the use of a single via waypoint.
Help please!!!
.
You need to add as many times via={lat},{lng} as you have waypoints:
# Note: line breaks and spaces are for readability only (they need to be removed)
https://router.hereapi.com/v8/routes?
origin=52.550464,13.384223
&transportMode=car
&destination=52.477545,13.447395
&via=52.529791,13.401389
&via=52.513079,13.424392
&via=52.487581,13.425079
&apikey={YOUR_API_KEY}
Related
Limitations on Waypoints in Here-Maps SDK & Routing Performance measurement
I am using HERE Route Matching v8 and having the same question.
Is there still the limitation of 200 waypoints in a single request now?
Thanks.
I want to know the Limitation for waypoints when using HERE Route Matching v8
Thanks for the question. We would suggest you use waypoints with small sizes, and you are right the current limitation is still under 200 waypoints, this restriction is on the URL characters limitation, not the request itself.
Can someone explain/point to documentation that explains the 'segmentRef' attribute that gets returned by the Here Routing API v8 when spans="segmentRef". An example of what gets returned is shown below. The middle part seems to be the topologyID but I can't figure out the rest. Thanks.
$0:321534451:$1:457679505#-0..0.7675126869621484
In v8, segmentRef is returned instead of PVID. spans conceptually replace link attributes.
Please refer the screenshots of supported link attributes.
For more details please refer the below api guide.
https://developer.here.com/documentation/routing-api/migration_guide/index.html
segmentRef is a parameter used in the HERE Maps API to identify a specific segment of a route. The segmentRef parameter is used to reference a specific segment within the route, and can be used in conjunction with the HERE Routing API to retrieve information about that segment. The information that can be retrieved for a segment includes details such as the start and end coordinates, the length of the segment, and the type of road along which the segment is located.
The segmentRef parameter is typically used in conjunction with other parameters, such as origin and destination, to define the overall route and retrieve information about specific segments within that route.
We use Routing API v8 to build truck routes!
In our country constructed many new roads! But info on 'trucknopttile' tile is incorrect at now! Truck route built in incorrect way!
How can we improve this information and change this behavior?
Does v8 API have option like in v7 - 'truckRestrictionPenalty'?
Example:
Wrong weights limit signs on the bridge
Example request:
routes?transportMode=truck&origin=49.81208246726337,24.157407830301196&destination=49.81755155059492,24.147335560752186&return=polyline,tolls,summary,routeHandle,passthrough,incidents&alternatives=3¤cy=EUR&units=metric&departureTime=any&avoid%5Bfeatures%5D=seasonalClosure,uTurns&avoid%5BzoneCategories%5D=environmental&vehicle%5Btype%5D=tractor&vehicle%5Blength%5D=1650&vehicle%5Bwidth%5D=255&vehicle%5Bheight%5D=373&vehicle%5BgrossWeight%5D=38000&vehicle%5BweightPerAxle%5D=11500&vehicle%5BaxleCount%5D=5&vehicle%5BtrailerCount%5D=1&spans=incidents,length,duration,countryCode,routeNumbers,speedLimit,dynamicSpeedInfo,notices&apiKey={API KEY}
Routing v7 had a strict approach to truck restrictions. There, no route which violated some truck restriction(s) was ever returned. It was possible to change this behavior with truckRestrictionPenalty parameter, but even then Routing v7 provided only a generic notice: Code: routingOptionViolated, Text: truckRestriction.
If Routing v8 cannot find any route that obeys all specified options and vehicle parameters and that avoids all applicable restrictions, by default, the response will contain a route that violates some restrictions. The response will also contain a set of critical notices explaining which restrictions could not be avoided. In some areas, this is not possible, for example in Romania, where almost all of the main roads have a 11.5t per axle restriction.
For more detail please refer below api document.
https://developer.here.com/documentation/routing-api/migration_guide/index.html
I need to get the coordinates of all route points through the CURL - in the HERE API documentation, I did not click on how to do it. Tell me what you need to create a request or give a link to the HERE documentation
With HERE Routing v8 API, you can get the route shape by specifying return=polyline in the query parameters, as shown in this guide.
Keep in mind however, that this returns a so-called "flexible polyline", which is an encoded representation of the route shape coordinates. It looks like this:
"polyline": "BGwynmkDu39wZvBtFAA3InfAAvHrdAAvHvbAAoGzF0FnGoGvHsOvRAA8L3NAAkSnVAAoGjIsEzFAAgFvHkDrJAAwHrJoVvb0ezoBAAjInVAA3N_iBAAzJ_Z"
You can use a decoder to get the coordinates. Here is a JS implementation of the decoder. The heremaps/flexible-polyline contains implementations in several other languages.
I have built an small application which calls the Google Directions API in Transit mode. It works - nevertheless it returns only one possible route, so it shows no alternatives. Usually I expect 3-4 options to choose from.
Example:
http://maps.googleapis.com/maps/api/directions/json?origin=bieberstrasse,+dusseldorf&destination=norf,+neuss&sensor=false&mode=transit&departure_time=1399399424
The returned JSON structure has the expected "routes" array, but this array always has only one element. I have tried it with addresses in Brazil and Germany - it doesn't matter the country, I only get one single route.
Did I miss some parameter? Could someone help me with it?
If you want alternative routes, specify the request parameter alternatives=true:
http://maps.googleapis.com/maps/api/directions/json?alternatives=true&origin=bieberstrasse,+dusseldorf&destination=norf,+neuss&sensor=false&mode=transit&departure_time=1399399424