We're trying to migrate from routes v7 to routes v8. Using v8, how can we get a breakdown of miles per US State?
In version 7.2 we could do
And the state codes would be in the summaryByCountry element:
"summaryByCountry": [
{
"distance": 189887,
"trafficTime": 8239,
"baseTime": 8206,
"flags": [
"motorway",
"builtUpArea"
],
"text": "The trip takes 118 mi and 2:17 h.",
"travelTime": 8206,
"country": "South Carolina",
"_type": "RouteSummaryByCountryType"
},
...
In version 8, a similar request:
"spans": [
{
"offset": 0,
"truckAttributes": [
"open"
],
"length": 1460740,
"countryCode": "USA"
},
{
"offset": 14050,
"truckAttributes": [
"open",
"tollRoad"
],
"length": 272,
"countryCode": "USA"
},
{
"offset": 14053,
"truckAttributes": [
"open"
],
"length": 23153,
"countryCode": "USA"
}
v7: summaryByCountry
v8: Not present. If spans are requested with spans=countryCode,length, then information about the distance in each country can be retrieved. No plans to support in any other manner.
Response in v8 contains :
spans": [
{
"offset": 0,
"truckAttributes": [
"open"
],
"length": 76817,
"countryCode": "USA"
}
],
link to migration guide : https://developer.here.com/documentation/routing-api/migration_guide/index.html