I used route[‘features’][0][‘properties’][‘segments’][0][‘distance’] to get the distance of three consecutive points but I only got distance between first and second point only.
Note, that this is easier to see when pasting code using the syntax formatting provided by discourse, which is done by enclosing text in 3 backticks (```), which will format it as a code block or enclosing text in 1 backtick (`), which will format it inline.
For a documentation of your route-geojson, refer to the documentation of route in the response tab of the documentation of the default directions endpoint (click on the green questionmark). Disregard any keys not present in your response.
When asking for a route using more than two coordinates, every pair of coordinates defines a segment, i.e. the route between these two coordinates.
Jakob,
I finally got the whole distance after you said to refer my geojson route. I am really grateful.
But now I don’t understand the backticks and quotes that you mentioned. So which one is the real python syntax, backticks(`) or quotes(’)?
The docs.python link you shared does not mention anything about backticks and I did not type down any backticks character in my post. So I am confused right now😅. Please help me understand the problem, I am currently a student and new to python.
Thank you.
Best regards,
Izzat
Now I get it. The (') converted to (’) when I paste the code here. So I need to use backtick to keep the format. This is my first time knowing such detail and how both are different. Thank you so much for the knowledge.