Overcoming Some Pitfalls of the Google Maps API

Intro

Recently I had to integrate with Google Maps API for a job-related task. I had a great experience working with Google Maps API both on the backend and frontend, but it was not without problems and a lot of research. In fact, I did learn a lot and for this very reason, I decided to share some of the most interesting pitfalls that I fell in.

To show you what I learned I assembled a small no-brainer application. It is a Spring Boot/Thymeleaf web application with the mission to display on a map the employees from an organization. It can display a particular employee on the map, all the employees on the map, and during the creation of an employee, it allows picking an address from a pinpoint on a map. The features that I decided to implement are for the sake of tutorial purposes and they may not make a lot of sense sometimes. The app can be found here: employee-locator

Bulk Geocode Addresses Using Google Maps and GeoPy

Geocoding is the process of converting addresses (like a street address) into geographic coordinates (like latitude and longitude). With Woosmap you can request nearby location or display on a map a lot of geographic elements like stores or any other point of interest. To take advantages of these features, you first have to push geocoded locations to our system, as we discussed in this previous post. Most of the time, your dataset has addresses but no location information.

The following script, hosted on our Woosmap Github Organization, is a basic utility for geocoding CSV files that have address data included. It will parse the file and add coordinate information as well as some metadata on geocoded results like the location type, as discussed below. It calls the Geocoding API through the GeoPy Python client.