Hi
I want to be able to pass 2 points, and retrieve for each road the road name, distance until next road, speed limit, … etc.
I need to do some calculations for fuel consumption on a route and need that kind of data
Is this possible?
Hi
I want to be able to pass 2 points, and retrieve for each road the road name, distance until next road, speed limit, … etc.
I need to do some calculations for fuel consumption on a route and need that kind of data
Is this possible?
Yes, take a look at the ‘details’ parameter.
How do these segments work? I’m trying to get like information for each road but I’m getting confused by these segments. How would I loop on these?
It is explained in this article that is linked in the documentation I linked to above. Each path detail list entry corresponds to two indices into the points
array and a value. There is a new entry whenever the value changes, so a single entry might cover multiple ‘roads’. To find the beginnings and ends of single roads you could probably use the street_name
or edge_id
details. Looping over the segments should be no problem since they are JSON lists.
Could you explain what the edge_id does?
Every ‘edge’ of the routing graph has a unique number, the edge_id. Basically each connection between two neighboring junctions (=points where more than two roads meet) is an edge. Therefore when you request the edge_id
path detail you’ll get a separate segment for each such edge.