API - HERE Routing - How to get miles driven per each state? - here-api

For any given route e.g. Brooklyn, NY to Seattle, WA, I need to calculate amount of miles we drove via each state.
I have tested multiple routing APIs and non of them return anything I could use in calculation. (I testes MapQuest, google and TomTom)
I spoke to HERE.com sales rep and he told me HERE-apis return that info but after running test calls it does not look to me that this is the case.
Does anyone know how to format query on HERE-api to get info I am looking for or any other way?

HERE Routing API does not support a feature to calculate to calculate the sum of amount miles grouping by State level. But probably you can do post process for the calculation the sum of amount miles based on road network in State level.

Related

How to calculate fare

like Ola, Uber etc. how they calculate fare
Example when I start from one point to another (like 1 to 2km) shows amount that is 40 rs
how they calculate use map distance in code or something else in code can u please explain how it work? Simply how it works fare system works?
This is lifted directly from the Uber website:
Many data points go into calculating an upfront price, including the
estimated trip time, distance from origin to destination, time of day,
route, and demand patterns. It also includes tolls, taxes, surcharges,
and fees (with the exception of wait time fees).
Some cities do not provide upfront prices. Instead, you’re charged
either a minimum price or a price based on the time and distance for
your trip’s route, which may include a base fare, a Booking Fee,
surcharges, tolls, and dynamic pricing. Prices may vary by location,
the vehicle option you select, and other factors.
So it sounds like a combination of any relevant data points your app is able to collect and that you feel should be considered billable are applied to the calculation. I imagine you would want to use the map distance rather than a predefined route in case of detours, traffic, etc.

Here Maps Telematics TOLLS API - specifying roundtrip

I am working with Telematics API https://fleet.ls.hereapi.com/2/calculateroute.json to calculate the toll costs. Can I please ask if anyone has used or aware if there is a special parameter to denote one way or round trip. I am using waypoints to represent round trip as in waypoint0 = source, waypoint1=destination, waypoint2=source to represent my round trip. The values returned are high compared to the ones indicated by local teams who use that toll regularly
As example 59.9133301,10.7389701 -> 60.6244351,11.3831208 -> 59.9133301,10.7389701 shows 816 NOK but real value is only 660. A one way from 59.9133301,10.7389701 -> 60.6244351,11.3831208 shows 340 NOK which may be right
So is there another way on API to ask for toll cost combined for both directions?
Thank you for your assistance
Please share you complete request. I am unable to reproduce the issue.
You can refer to these example request:
Round Trip request :
https://fleet.ls.hereapi.com/2/calculateroute.json?jsonAttributes=41&waypoint0=59.9133301,10.7389701&detail=1&waypoint1=60.6244351,11.3831208&waypoint2=59.9133301,10.7389701&maneuverAttributes=none&linkAttributes=none,sh&legAttributes=none,li&currency=NOK&departure=&tollVehicleType=2&trailerType=0&trailersCount=0&vehicleNumberAxles=2&trailerNumberAxles=0&hybrid=0&emissionType=5&fuelType=petrol&height=1.67m&trailerHeight=0&vehicleWeight=1739&limitedWeight=1.739t&disabledEquipped=0&minimalPollution=0&hov=0&passengersCount=2&tiresCount=4&commercial=0&heightAbove1stAxle=1m&width=1.8m&length=4.41m&mode=fastest;car;traffic:disabled&rollups=none,country;tollsys&&tollPass=transponder&apikey=<apikey>&jsoncallback=parseRouting
Result TollCost: 244.8
One way request :
https://fleet.ls.hereapi.com/2/calculateroute.json?jsonAttributes=41&waypoint0=59.9133301,10.7389701&detail=1&waypoint1=60.62544,11.37563&maneuverAttributes=none&linkAttributes=none,sh&legAttributes=none,li&currency=NOK&departure=&tollVehicleType=2&trailerType=0&trailersCount=0&vehicleNumberAxles=2&trailerNumberAxles=0&hybrid=0&emissionType=5&fuelType=petrol&height=1.67m&trailerHeight=0&vehicleWeight=1739&limitedWeight=1.739t&disabledEquipped=0&minimalPollution=0&hov=0&passengersCount=2&tiresCount=4&commercial=0&heightAbove1stAxle=1m&width=1.8m&length=4.41m&mode=fastest;car;traffic:disabled&rollups=none,country;tollsys&&tollPass=transponder&apikey=<apikey>&jsoncallback=parseRoutingResponse
Result toll cost 113.6
Back to source
https://fleet.ls.hereapi.com/2/calculateroute.json?jsonAttributes=41&detail=1&waypoint0=60.6244351,11.3831208&waypoint1=59.9133301,10.7389701&maneuverAttributes=none&linkAttributes=none,sh&legAttributes=none,li&currency=NOK&departure=&tollVehicleType=2&trailerType=0&trailersCount=0&vehicleNumberAxles=2&trailerNumberAxles=0&hybrid=0&emissionType=5&fuelType=petrol&height=1.67m&trailerHeight=0&vehicleWeight=1739&limitedWeight=1.739t&disabledEquipped=0&minimalPollution=0&hov=0&passengersCount=2&tiresCount=4&commercial=0&heightAbove1stAxle=1m&width=1.8m&length=4.41m&mode=fastest;car;traffic:disabled&rollups=none,country;tollsys&&tollPass=transponder&apikey=<apikey>&jsoncallback=parseRoutingResponse
Result tollcost 131.2
Toll cost of route (1) = toll cost of route (2+3)

HERE Toll cost calculation information missing

I am trying to implement a route calculator with the HERE API. I should show the toll costs of the given route for the user. However, I have some questions, I could not find any answer in the documentation for:
Are the given toll costs net value, i.e. is VAT included or not? Based on my test requests, it looks like there are some countries where VAT is included, and it is excluded in others. Are there any arguments in the result from HERE providing information on this?
One can specify the currency in which the costs are calculated, but I could not find any information on the exchange rates applied. I would like to show this also for the user. Is it possible to get this in the result, too? Or maybe is the source of this data public?
As the toll costs and the toll roads may change over time, I would like to also show the time of data for the user. Is there any argument for this given back by HERE in the result?
I assume you are using the HERE Fleet Telematics API.
VAT is expected to always be included. No, there is no such argument in the API.
No, you cannot get this information in the results. The only trick I can suggest, is to make 2 consecutive calls to the API, one using the first currency and another one using the second currency, and therefore derive from these results the applied exchange rate.
There's no such argument. You should assume that HERE's toll cost data is always fresh.
Toll cost calculation is provided via Here Fleet Telematics API.
Total toll cost includes the VAT
And as per the documentation the below details can be retrieved.
In addition, toll cost detail can be requested on different levels, using the "rollups" parameter:
a. total summary only
b. cost per road link
c. cost per country
d. cost per toll system
Exchange rates are not provided rather currency can be provided.
There is no history of route calculation provided , all the data that are provided are latest.

Average number of cars per time unit using HERE traffic API response

Is there a way to get the average number of cars per time unit on each road in a bounding-box on a map using HERE traffic API ? or na indicator of this rate ?
The final goal would be to get the info regularly, and give the option to filter and average the data over time to display the results on a map.
Thanks
This is not possible with any of the APIs currently available on our developer portal. I'm not sure this is available at all, but you can use the contact us form on the portal to enquire about our Enterprise offering around traffic.

Getting Total Miles In Each State Passed

I would like to know if it is possible to get the total miles traveled (via road/interstate) in each state instead of the total miles only.
For example: From Chicago, IL to Atlanta, GA the total miles traveled in each state would be:
IL=16 miles
IN=284 miles
KY=137 miles
TN=152 miles
GA=128 miles
From what I understand this is not possible in google maps api but I wanted to see if it is possible using anything else, Bing, YAhoo, Mapquest ???
Thanks for any help...
You might be able to use the MapQuest Directions Service to come up with very basic/general distances for each state, but I'm not sure if the distances will be exact enough to fit your needs. Basically, the directions service returns driving directions in terms of "maneuvers" and you can make a request to the directions service that tells it to include crossing state boundaries in the maneuvers it returns. You may be able to parse the data that is returned to calculate the route distances between the "crossing into (state name)" maneuvers, but again, it might not be exact enough.
It might be worth a look. I've never done this before, but it's my first thought. The MapQuest Developer Network has forums, so it might be worth it to post the question there, too.
You can keep track of miles driven in each state (Example: Travel from home in New Mexico to (any city)Texas. These programs will do this for you, Trulos.com, IFTA Plus, truckingoffice.com, ifta-calculator.com Some are free others usually give a 30 day free trial. I use programs like this when I'm filing mileage/fuel reports for commercial drivers. These drivers always have to report how many miles they travel in "each" state. All you have to enter is the location of your starting point and your final destination. The program will then calculate your miles traveled for each state and also will give you the "total" miles traveled.

Resources