Example Notebook
Author: Alexander Michels
[1]:
import contextily as cx
from IPython.display import display
import ipywidgets as widgets
import sys
sys.path.insert(1, "../")
import mycybergis
mycybergis.__file__
[1]:
'/home/dijkstra/Documents/GitHubRepos/github-pages-demo/notebooks/../mycybergis/__init__.py'
[2]:
from mycybergis import *
[3]:
uiuc = get_uiuc_polygon()
uiuc
[3]:
[4]:
m = get_map_of_uiuc()
m
[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
[5]:
uiuc_gdf = get_uiuc_gdf()
uiuc_gdf
[5]:
geometry | |
---|---|
0 | POLYGON ((-88.20950 40.08370, -88.24690 40.083... |
[6]:
uiuc_gdf.crs
[6]:
<Geographic 2D CRS: EPSG:4326>
Name: WGS 84
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World.
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984 ensemble
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
[7]:
ax = uiuc_gdf.plot()
cx.add_basemap(ax, crs=uiuc_gdf.crs.to_string())

[8]:
uiuc_gdf.explore()
[8]:
Make this Notebook Trusted to load map: File -> Trust Notebook
[9]:
buffer_slider = widgets.FloatSlider(
value=1000,
min=0,
max=10000,
step=0.1,
description="Buffer:"
)
display(buffer_slider)
[10]:
buffer_val = buffer_slider.value
buffer_val
[10]:
1000.0
[11]:
buff = get_uiuc_buffered_gdf(buffer=buffer_val)
buff.explore()
[11]:
Make this Notebook Trusted to load map: File -> Trust Notebook