Data Analyst Project #1 — Commute Times Optimiser

Common Man
3 min readApr 20, 2021
Photo by Viktor Forgacs on Unsplash

I spent a LOT of time on commuting to work every day.

Sometimes, I find it difficult to wake up early every morning. When I get up late, most likely it will take me longer to commute to my company.

One day, an idea suddenly hit me.

Why don’t I build a webpage which allows me to collect commuting time of all the routes during a specific period of the day, so I can find the best departure time which has the least commuting time.

The commuting time information and its route information can be obtained from Google maps API.

Following will be a user guide to explain how to use this webpage.You can access this webpage in my personal website through the link here.

Step 1. You need to type in the start location in the top right corner box.

In this example, we will choose:

1 Captain Cook Drive, Woolooware

And select the start location in the autocompletion dropdown menu.

Screenshot for Step 1

Once you click the location in the dropdown menu. The map will automatically zoom into that location as shown below. This will allow you confirm if you select the right location.

Step 2. You do the same thing for the destination.

In this case, we will choose:

10 Westleigh Street in Neutral Bay

Once start location and destination have been selected, the map will zoom out to show both location marked with red pin as shown below.

Step 3. You need to pick the date and time you want to leave. Date is important to determine which route is available, since the public transport schedule varies between weekdays and weekends.

In this case, we will pick:

8 AM on 2021 April 12th as the earliest departure time.

INSERT SCREENSHOT OF TIME.

Step 4. Once they are all set, just need to click that “Visualize Travel Time” Button. It will get all possible public transport routes information through Google Maps API (including their departure time, arrival time and total commute time) for the next two hours automatically.

At bottom, it will tell the progress of data collecting.

Screenshot for Step 4 (Data Collection Progress Shown at Bottom)

Once all data is collected. A commute time vs depature time bar chart will be plotted and the route with the shortest commute time will be rendered on the map. You can see depature time, arrival time and the duration for each route in bar chart.

Screenshot for Step 4 (With Commute Time vs Departure Time Bar Chart and Public Transport Route Rendered)

From here, we can see the route which takes the shortest time

Compare to the route which has the longest duration (115 minutes), it can save you about 20 minutes one trip, if you choose to leave around 8 o’clock.

There you go, this is what the webpage can do. In summary, it just summarise all available public route information from Google Maps and plot it on a bar chart, so you do not have to do this manually.

The code will be available in my github link with comments to explain each step.

If you like this tool or has any suggestion, let me know by leaving me a comment.

--

--

Common Man

An Individual who is passionate about data analyzing and AI