API purpose: Getting GPS data (amongst a bunch of other things)
Signup: Via your google account.
Comment: Easy Peasy!
A super simple one today. Working through these location maps I’ve had to input GPS coordinates for a call and I thought it would be nice to be able to feed in a nice address and get a nice GPS coordinates. Turns out google provide this service and its super easy to use.
So I looked at a function for geocoding (taking an address and converting to GPS), this can be simply altered for reverse geocoding too (taking GPS and converting to an address). The latter is important too as some functions in API’s return a GPS and its not meaningful as an output (or nobody knows what the hell it means.
So the code today is super simple as a nice man made a python wrapper for all of this. So rock over to https://github.com/googlemaps/google-maps-services-python or just run:
sudo pip install -U googlemaps
You are basically good to go then. So I wrote two short scripts that are available on the github link above, the scripts are pretty easy and build on the python tricks I built up in the other tutorials.
Here’s the API call, very similar structure to the TFL structure!
And it works! Go me.