0

How would an HTTP request or API request retrieve navigation data from Google Maps? Are there some simple lines of code for that? Let's say I want to give an input of origin and destination address, then the results of car, public transport, walking etc. are given with distance, required time and so on. Basically, setting the navigation UI Google Maps settings which results in a somewhat tabular form or any other format that can be used for analyzing.

Thank you in advance!

1 Answer 1

0

Yes, from R you can call Google Maps' Directions API.

API calls look like this:

https://maps.googleapis.com/maps/api/directions/json
?destination=Perth%2C%20AU
&origin=Sydney%2C%20AU
&waypoints=via%3Aenc%3AlexeF%7B~wsZejrPjtye%40%3A
&key=YOUR_API_KEY

You can specify to receive results in either JSON or XML.

You will need an API key.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.