Reputation:
My project simply needs to be able to send requests to your server every 3 seconds to determine the current speed zone a vehicle is travelling on and have your api return the speed zone value.
I do not require any other info other than speed zone value which in my product will have that speed zone value displayed to the driver via a small screen mounted on the dash. The screen will only display the current speed zone the driver is driving on in real time.
Can you point me to the resource that will advise me how I can achieve the above task
Claude Raiola
Upvotes: 0
Views: 99
Reputation:
You have different ways to get the speed limit of a particular lat,long using Here APIs. Listing two ways down(without the need to route):
Using mode=trackPosition parameter along with locationattributes=linkInfo you will be able to get the speed info for a particular lat,long. Read more about it in https://developer.here.com/documentation/geocoder/topics/resource-reverse-geocode.html. Below is an example.
https://reverse.geocoder.api.here.com/6.2/reversegeocode.json?pos=41.8842%2C-87.6388&mode=trackPosition&maxresults=1&gen=9&app_id=xxxx&app_code=yyyy&locationattributes=linkInfo
Coverage for this API can be viewed here - https://developer.here.com/documentation/geocoder/topics/coverage-geocoder.html
PDE You can achieve this by using PDE API(Platform Data Extension). PDE provdes the speed data for an entire tile chosen unlike Reverse Geocoder which provides only for a particular lat,long.
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
Read more about it in the developer site - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html
For coverage details view https://developer.here.com/documentation/platform-data/topics/coverage-information.html
Hope you find this useful!
Upvotes: 1