I would like to use the HERE navigation API so that I arrive at the destination in a certain heading (in degrees from north, for example). This may require a detour to arrive at the destination in the correct direction. Can this be done? How?
EDIT: Also for a regular routing request, I would like to know the heading at the destination.
Please check Fleet Telematics API documentation on how to provide the heading for a waypoint - https://developer.here.com/documentation/fleet-telematics/api-reference.html. The documentation also helps us understand how to retrieve heading information in the response using customattributes parameter.
waypoint0 ... waypointN
required
string
Comma separated waypoint latitude, longitude in WGS-84 degree. A route must consist of at least 2 waypoints (start and destination). The maximum number of waypoints is limited. However, this limit is not a fixed number but is a result of the limit for the overall processing time. Set a transit radius by ;10000 to only influence the route to go via a certain city Set a heading by ;;;140 (degree clockwise from North) to improve map matching To define a loading/delay time at a waypoint, use stopOver[,timeInSeconds]!. Example: &waypoint1=stopOver,300!50.12,8.65. The optional specifications altitude, custom label, !StreetPosition and !LinkPosition are currently supported. The coordinates may be directly followed by ;transitRadius;label;heading. Waypoints can have opening and closing times, can be unsorted or optional. Details are in Key Concepts / Waypoint sorting, optional Pickup and Opening Times
Related
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.
Using HERE Maps Api, for a geographic coordinate (lat, lng), I would like to find address information for the nearest routable road. Information that includes:
Address (street, house number, city, postal code, country)
Bearing/Heading of the road (0 to 360 degrees from True North)
How can I achieve this through HERE Maps API?
So far, this is what I have been able to achieve:
Calling the calculate Route API with identical start and end endpoints and mode=car will force the API to snap to the nearest routable point. This step is necessary for when the input coordinates are for a pedestrian street.
Using the nearest routable point coordinates, I can call reverse GeoCode API and I will be able to find the address information I need.
The next step is where I'm currently stuck. I'm able to find information like direction=NW, however I can't find the ~exact bearing in grad, for example bearing=265.
Is this achievable? Are 3 steps really necessary or is there a HERE Maps API endpoint that can provide all of this?
You can use the Fleet Telematics API to get the headings value for a particular road. Read more about the api here - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html
You can also look at the field explanationshere - https://tcs.ext.here.com/pde/layer?region=WEU&release=19111&url_root=pde.api.here.com&layer=ADAS_ATTRIB_FC1
HEADINGS Horizontal road heading [10^-3 degree] at coordinate points along the link, when driving from Reference Node. Comma separated. Each value is relative to the previous. No values here for the ref/nonref nodes, because they are in the separate fields REFNODE_LINKCURVHEADS and NREFNODE_LINKCURVHEADS.
I am wondering to find a way to fetch exactly similar results of google grocery stores near to me
I have used the below API to get nearby grocery stores
https://maps.googleapis.com/maps/api/place/nearbysearch/json?sensor=true&radius=5000&key=AIzaSyC9rFJ90pP1oHpLrqpR2B0HtUboLaHmnDw&location=45.4940475,-73.5606149&type=supermarket&rankby=prominence
but it's not showing the all popular stores with matching to google grocery stores near to me best match (attached images).
What is the way to achieve functionality by applying filters From API? please, advice appreciated if its possible immediate replay.
Thanks
The API only will gather data by distance, prominence, and type. It is up to you how you want the data be sorted/filtered and which to display to your users.
Get your data: rankby
If rankby=distance (described under Optional parameters below) is
specified, then one or more of keyword, name, or type is required.
If you want to rank by distance, you will need to remove radius parameter form your url.
radius — Defines the distance (in meters) within which to return place
results. The maximum allowed radius is 50 000 meters. Note that radius
must not be included if rankby=distance (described under Optional
parameters below) is specified.
This will get you started. Places Library
So I want to find different walking routes where the start and end destination is the same. So If I as a user choose 5km, maps would show me routes that are about 5km long and start and ends at the same location. I have looked through the (messy) maps apis but haven't managed to find any endpoints for doing this.
You can do something like that by adding waypoints. So for a 5km walk you could generate a random point within 2.5 km of your start/end point and add it as a waypoint when generating directions.
Edit:
In addition you may try using the Geometry library in the Google Maps API. There is a computeOffset function which returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north). This way you can add some waypoints relative to the start/end point. Or in close proximity to the random first waypoint.
https://developers.google.com/maps/documentation/javascript/directions#Waypoints