This notebook briefly walks through calculating spatial accessibility to hospital ventilators in across the state of Illinois. This work uses the code from the following paper:
Kang, JY., Michels, A., Lyu, F. et al. Rapidly measuring spatial accessibility of COVID-19 healthcare resources: a case study of Illinois, USA. Int J Health Geogr 19, 36 (2020). https://doi.org/10.1186/s12942-020-00229-x
Paper Authors: Jeon-Young Kang, Alexander Michels, Fangzheng Lyu, Shaohua Wang, Nelson Agbodo, Vincent L. Freeman & Shaowen Wang
Notebook Authors: Alexander Michels, Zimo Xiao, Anand Padmanabhan, Zhiyu Li, Shaowen Wang, Mit Kotak and Taylor Ziegler
import contextily as cx
import geopandas as gpd
import os
Let's connect to the CyberGIS-Compute server:
from cybergis_compute_client import CyberGISCompute
cybergis = CyberGISCompute(url="cgjobsup.cigi.illinois.edu", isJupyter=True, protocol="HTTPS", port=443, suffix="v2")
When the UI comes up, we will select "covid-access" from the Job Configuration tab's "Job Templates" dropdown. Then select submit.
Note that this will take approximately 20 minutes. If you close the browser or if the kernel goes to sleep at some point, you can restore the job from the "Your Jobs" tab.
cybergis.show_ui()
Wait for the job to finish to run more cells. These cells all depend on the results of the job!
When the job finishes, go to the "Download Job Result" tab and select "/" from the dropdown (it should be the default choice). Then click the "Download" button and wait for the download to finish.
Once the download is finished, you can run the cell below to get the download path:
download_path = cybergis.recentDownloadPath
print(f"Our outputs are at {download_path}")
Let's list the stuff we downloaded from the HPC resource:
!ls {download_path}
Now, let's load the result GeoJSON object:
result_path = os.path.join(download_path, "result.geojson")
gdf = gpd.read_file(result_path)
gdf.head()
We can plot the spatial accessibility output with the cell below:
ax = gdf.plot(column="hospital_vents", cmap="OrRd", figsize=(8,10), legend=True)
cx.add_basemap(ax, crs=gdf.crs.to_string())
...or we can create an interactive visualization with the geopandas explore
function:
gdf.explore(column="hospital_vents", cmap="OrRd")