title | layout |
---|---|
Lecture 11 |
lecture |
conda install -c conda-forge ipyleaflet
jupyter labextension install jupyter-leaflet
jupyter labextension install @jupyter-widgets/jupyterlab-manager
import ipyleaflet
m = ipyleaflet.Map()
display(m)
Now, zoom waaaaay out.
We will refer to all of our "data objects" as Layers with ipyleaflet. These can include:
- Tiles
- Markers
- Image / video overlays
- Polyline / MultiPolyline / Polygon / MultiPolygon
- Rectangle / Circle
- Marker Cluster
- Heatmap
m.add_control(ipyleaflet.LayersControl())
This will let us choose and manipulate individual layers.
import json
with open("champaign_trees.geojson") as f:
gd = json.load(f)
layer = ipyleaflet.GeoJSON(data = gd)
m.add_layer(layer)
Retrieve either the CUMTD data yourself from developer.cumtd.com or on Whole Tale in "Code Along."
Let's visualize the routes.
This data is in the GTFS format. It has routes, trips, stops, etc.
Step 1: load the stop and route data files
Place markers for stops on the map.
Add a layer for a heatmap of stop locations.
First, try out kepler.gl
We can display the map in a jupyter notebook.
import keplergl
k = keplergl.KeplerGL()
display(k)
gd = pd.read_csv(" ... ")
k.add_data(data = gd, name = "my data")
Load the tree data
Display heatmap, with varying values
conda install voila
Now, let's take one of our notebooks and make it a dashboard.
Time for you to meet with your groups.