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 need to know the speed limit for some coordinates from the vehicle's trip.
If I do POST request like:
https://fleet.cit.api.here.com/2/calculateroute.json?routeMatch=1&mode=car&attributes=SPEED_LIMITS_FCn(*)&&app_id=APP_ID&app_code=APP_CODE
with body:
LATITUDE,LONGITUDE
37.401996,-122.041338
37.416438,-122.086022
I'm receiving back built route with very many coordinates.
But I'm interested in only two coordinates...
Is there a better way to get speed-limit for a few (~10-100) coordinates?
This will get an array of link and if speed limit is available in map data, it would be returned for the link. linkAttributes and routeAttributes will limit the response of parameters. the default response however can't be limited.
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=xxx&waypoint0=42.4065,-113.3798&waypoint1=42.2821,-83.74847&mode=fastest;car&inkAttributes=speedLimit,dynamicSpeedInfo&legAttributes=links
speedinfo can come via geocoder API in the form of speed category like below that will be based on the address location.
https://geocoder.ls.hereapi.com/6.2/geocode.json?searchtext=Castro%20St%20Mountain%20View%20Santa%20Clara%20US&gen=9&apiKey=xxxxx&locationattributes=li
I'm totally novice for Rest Api, so i'm looking for example code. I've a set of geographical coordinates taken from a database and I need to find best route among these. I'm using Bing Maps, let say I have an idea how to code the Rest request, my problem is how parse and manage the JSON response to draw the route on the map in a asp.net page.
Assuming you're using the Bing V8 HTML control, the directions module will handle making the REST request and displaying the result for you - there's no need to parse the REST response directly yourself. See https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk/directionscreatedrivingroute
If you're using one of the other controls, similar modules are available.
I've found this JSON, is a step to step guide to request and consume JSON response.
I'm trying to get speed limit from Here API maps but I can't find the way to do it. I tryed few example on web site but the only one that works is the one which require point of start and point of stop of the route.
I would like to get the speed limit given only one point ( or a box ). Which api do I have to use? Is there an example?
https://route.cit.api.here.com/routing/7.2/calculateroute.json?jsonAttributes=1&waypoint0=51.31854,9.51183&waypoint1=50.11208,8.68342&departure=2019-01-18T10:33:00&routeattributes=sh,lg&legattributes=li&linkattributes=nl,fc&mode=fastest;car;traffic:enabled&app_code=appcode&app_id=appid
This is the waypoint one but is not what I'm looking for, I would like to pass it only a Latitude / Longitude.
Thank you
You can achieve this by using PDE API(Platform Data Extension)
You have to first map your geocordinates(lat,long) to a navigable position(lat,long) for the given coord and the Functional Class(FC1-5) it is located in. This you can achieve by a simple geocoder request
You can calculate tilexy values based on the navigable lat,long and pass it to PDE API for querying speed limit layer on that particular FC class.
Look at https://tcs.ext.here.com/examples/v3/link_speed_locator example which covers this exact usecase.
Below is a sample geocoder request. Here prox parameter is your lat,long
https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json?app_id=xxxx&app_code=yyyy&prox=50.133848, 8.715332,500&mode=retrieveAddresses&maxResults=1&additionaldata=SuppressStreetType,Unnamed&locationattributes=linkInfo
Below is a sample pde request
https://pde.cit.api.here.com/1/tiles.json?layers=SPEED_LIMITS_VAR_FC1,SPEED_LIMITS_VAR_FC2,SPEED_LIMITS_VAR_FC3,SPEED_LIMITS_VAR_FC4,SPEED_LIMITS_VAR_FC5,ROAD_GEOM_FC1,ROAD_GEOM_FC2,ROAD_GEOM_FC3,ROAD_GEOM_FC4,ROAD_GEOM_FC5&levels=9,10,11,12,13,9,10,11,12,13&tilexy=536,398,1073,797,2147,1594,4294,3188,8588,6377,536,398,1073,797,2147,1594,4294,3188,8588,6377&app_id=xxxx&app_code=yyyy
Read more about it in the developer site - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html
Hope you find this useful!
The ReverseGeocoder has rarely used mode "trackPosition" (mode=trackPosition).
In combination with locationattributes=linkInfo you may retrieve the speed limit for that matching road.
I've got an application that draws a map using a set of LatLng points to create a polyline. I want to generate a static map of this path using the Google Static Map API and passed the result of the polyline's getPath() method to google.maps.geometry.encoding.encodePath to generate the encoded path. When I pass this to: https://maps.googleapis.com/maps/api/staticmap?size=400x400&path=weight:3%7Ccolor:orange%7Cenc:polyline_data where "polyline_data" represents the encoded line I get a status of "400 (Bad Request)"
When I cut the number of points down so I only pass in every 20th point the encoded path renders a static map correctly. My polyline is comprised of about 6000 points and when cut down to about 300 it renders cleanly.
I understand the resolution of the points I started with is to fine grained but have not been able to find what the actual limit is for the number of LatLng points passed to the encodePath method such that this encoded string can be passed to the google static map API. Can someone help point me at the specified limits? Thank you.
From the Web Services Documentation
Additionally, URLs are limited to 8192 characters for all web services. For most services, this character limit will seldom be approached. However, note that certain services have several parameters that may result in long URLs.