Skip to content

irahorecka/los-angeles-metro-map

Repository files navigation

los-angeles-metro-map


A Jupyter notebook repository for plotting real-time LA Metro bus coordinates on a map.

Introduction

metro_mapping.ipynb and gif_generator.ipynb complement each other in:

  1. Gathering images of real-time bus locations in Los Angeles, CA.
  2. Converting these images to a gif.

LA Metro bus gif

Python Setup

This script requires Python 3.5 and above. Please see requirements.txt for required Python libraries. Clone this repository and use pip to install the necessary libraries into your conda environment, like this:

pip install -r requirements.txt

You will have to install two additional libraries to properly execute export_png() from the bokeh.io module:

  1. pip install selenium
  2. conda install -c conda-forge phantomjs

Running the Notebooks

Run metro_mapping.ipynb entirely and execute main() to start collecting images (which will accumulate in the ./map_figs directory).
main() will run indefinitely. When you are satisfied with the accumulated images, click the square button at the top of the notebook to interrupt the kernel:

Interrupt kernel


Then, run the entirety of gif_generator.ipynb. Provide an appropriate name for your gif when prompted in main(). This will create a .gif file of your .png images in the ./gif_files directory.

GIF progress bar

Notes

A .png file will range from 200kb - 240kb in size. Accumulating hours of images can lead to a large .gif file. For example, 12 hours of images could lead to a ~ 1 GB gif image.

Please let me know if you have questions.

Fin

About

A repository for plotting real-time LA Metro bus coordinates on a map.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published