Keboola WIKI‎ > ‎Data Tips & Tricks‎ > ‎

Google Maps Geo-Coding

There is an increasing number of use cases and data projects for which geolocation data can add a ton of value - e-commerce and retail, supply chain, sales and marketing, etc.  Unfortunately, one of the most challenging tasks of any data project is relating geographical information to various components of the dataset. On a more positive note, however, KBC’s easy integration with Google apps of all kinds allows users to leverage Google Maps to add geo-coding functionality. Since we have so many clients taking advantage of geo-coding capabilities, one of our consultants, Pavel Boiko outlined the process of adding this feature to your KBC environment. Check it out!  

We have recently worked on several projects where customers had a business need to create a consistent and accurate list of addresses out of their database. To solve these needs we at Keboola have chosen Google Maps geo-coding functionality. You all know Google Maps will find the address you need almost whatever way you type it in. Usually, in regular life, what you are interested in is a pin on a map. But there is more than just a pin there. You can get coordinates of that address. Those old-school Longitude and Latitude.

Lets see some examples we came across at Keboola.

A lot of address information is still filled in manually and doesn’t pass verification during the entry. So businesses end up with all kinds of spellings of the same address. Some of you can feel our pain here: E 26th avenue, E  26th ave, East  26th avenue, E  26th Ave, East 26 Avenue, etc. Not so obvious to a machine if all of those come from the same spot.  But after going through geo-coding they will all turn into the same two coordinates. So when you put those coordinates together– you can say they are all the same address. All you need is choose one spelling and update your datasets.

Another case could be extracting some part of an address. Say you have full address in one cell and there is a need to know just a city or street name. Google Maps will return you all info about the addresses broken down in parts. Many various possible parts. City, province, postal code would be some of them. So you can say 100 - E 26th Avenue, Vancouver, BC V5V 5V5 is located in Vancouver. Not so hard to see that in one record. Now imagine you have 100,000 of those and you need to group them by city. Not a problem!

One more example - you may want to group addresses by geographical proximity. If you have coordinates of the addresses – it is not hard to group them by 10 km radius proximity for example.

You may have realized right now there could be another use case for your needs. Let us know!

Now to a bit of a technical stuff. Our cool Keboola developers have created an application to connect to Google Maps geo-coding API. We need to do some pre-setups for it to run smooth.

We create a list of addresses needed in a separate table.


Create a table that will serve as a storage of settings with our Google Developers API access token. Inside of the table (not shown here) we define location of the table we are going to process and name of column that contains addresses:


With the help of C:\Users\PB\Desktop\4.jpgwe create a connection to Google Maps geo-coding. This call creates an extractor inside of the Keboola. Every time your list of addresses changes all you need is to run the extractor by pressing one Play button. I am not even going to mention how easily those processes are automated with Keboola Orchestrator (Scheduler).


And here are our coordinates. All details of the addresses stayed behind the scroll bar in this example, but believe me they are there.


All you need is match addresses back to your input table and select all data you need for your final output.

Happy address hunting!