user3939487
user3939487

Reputation:

Newbie needing help to determine speed zones on real time of moving vehicles

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

Answers (1)

user3505695
user3505695

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):

  1. Reverse Geocoder API

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

  1. 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

    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

    For coverage details view https://developer.here.com/documentation/platform-data/topics/coverage-information.html

Hope you find this useful!

Upvotes: 1

Related Questions