Skip to content

Example of a simple website created with the Flask Library for a dynamic plot made with the Bokeh Library to plot a Geopandas db

Notifications You must be signed in to change notification settings

YannFra/Website-Flask-Bokeh-Geopandas

Repository files navigation

How to plot an interactive plot in a website. All in Python.

You have a dataset. How do you plot this dataset into a website ? Well guess what, here again Python can do all of that. From opening the dataset to creating a webpage including the interactive plot you did, there is nothing Python cannot do!

This tutorial/example will go through all the steps required to go from the dataset to inserting your dynamic plot in a webpage. We will be plotting the bikeways in San Francisco over the city’s streets. The questions this example answers are:

  1. How do you open and plot a geospatial database ? We will use GeoPandas to open a shapefile db (.shp).
  2. How do you make this plot interact with the user ? We will use Bokeh to create the interactive plot.
  3. How do you create a webpage including this plot ? We will use Flask to do so.

A lot of tutorials show how to do each of these parts independently. The goal of this tutorial is to include all of them into one example on the Bike Lanes network in San Francisco. The Python code used can be found in this GitHub and the explanations in this tutorial. Please contact me if you encounter any issue.

Python libraries used in this tutorial: Bokeh,Flask, and GeoPandas

Our example will be on the bike network in San Francisco. Where are the bike lanes in San Francisco ? Is there enough of them to commute in bike ? We will create a plot that superimposes the bike lanes network to the street network in San Francisco. Then we will allow the user to zoom this plot and to hide/show the desired networks.

This work was possible thanks to :

About

Example of a simple website created with the Flask Library for a dynamic plot made with the Bokeh Library to plot a Geopandas db

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published