A Jupyter notebook repository for plotting real-time LA Metro bus coordinates on a map.
metro_mapping.ipynb
and gif_generator.ipynb
complement each other in:
- Gathering images of real-time bus locations in Los Angeles, CA.
- Converting these images to a gif.
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:
pip install selenium
conda install -c conda-forge phantomjs
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:
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.
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