I always wanted to start a series of writeups to study the commute time of the bay area. It would be quite helpful for anyone who plans to move to the bay area to get a glimpse of what is it like to commute in bay area. For those who already work and live here, it may also worth another look at their commute methods.
Of course this would be a huge project, and there are already many different articles on this topic. To narrow it down, I specifically focus on two commute methods: cycling and driving. During non-rush hours, driving is almost always faster than cycling. However, cycling is in general, much less affected by traffic conditions. In heavy traffic condition, cycling could be a faster way to commute. The purpose of the whole project is to compare the commute time between driving and cycling within the South Bay during different times of a Weekday. This is Part I of the project: find out the cycling time within the South Bay. Data Preparation
The first task is to define it and break it into executable action items.
Geographical data
I’d like to plot the area of each Zipcode for Santa Clara County. The boundary of each zip is provided in the shape file that you can download from census.gov. We need to correlate each boundary with the corresponding Zipcode. You can download the Zip code from here.
Since Santa Clara is a big county, some remote Zips are excluded in the analysis.
Data Visualization
Let’s first take a look at each Zip on a map. The zip codes are grouped by each city.
Now, we can create a matrix to show the cycling time between any two zips.
Finally, we can show the commute time from one specific zip 94085 on a map.
Conclusion
The article shows how to plot geographical data on a map and call google map API using the ggmap package. For a big county like Santa Clara, the cycling time between to far away areas could be as long as 3 hours. In Part II of this series, I will exclude any pair of zips whose cycling time is more than 60 mins and compare the driving and cycling time. Stay tuned.
0 Comments
|
AuthorA mechanical engineer who also loves data. Archives
January 2018
CategoriesBlogs I enjoy reading |