

We'll achieve this in three simple tasks: (1) importing libraries and loading data (2) calculating durations/times and (3) finally adding the corresponding distances (you can start with distance if you like) to the list. Our task is to make a list of distances (and times) for all the data points (100 data points) we randomly created and used in the previous article. Google API service uses driving distance (although you can choose to use "walking" distance), which means it will calculate the distance based on the actual fastest routes or paths using the actual road network system (where applicable!).

The reason we use Google APIs is that it gives you the right/actual distance, as opposed to straight-line distances (known as Euclidian distances) offered by most tools. We will use very simple Python codes together with Google APIs. In this article, we are going to see the quickest - and arguably the simplest - way to get the distance between one specific location and many others, and the time it takes to travel that distance.

In our previous article, we mapped 100 data points at random locations in Rwanda.
