Code and Analysis Resources
Code notebooks and spatial analysis tutorials for research applications
Computational Notebooks & Coding Resources
Opioid Environment Toolkit in R-Spatial
This toolkit provides an introduction to GIS and spatial analysis for opioid environment applications. This code toolkit supports researchers, analysts, and practitioners with learning open source spatial analytic and visualization services in the R software environment. It includes geocoding MOUD resource locations, linking community contextual data, calculating new spatial variables, and conducting access analyses. All code, data, and workshops are free and open to public participation.
Opioid Environment Toolkit 2.0 (2026)
The latest, refactored toolkit series includes an improved experience, and will move from beginner to intermediate geocomputational and analytic examples. The first workshop, Intro To Spatial Data in R was published in 2025, with updated modules to be published and shared in the GCCP workshop series through 2027.
Opioid Environment Toolkit 1.0 (2021)
The original version of the toolkit was developed from 2020 to 2021, and may be used with corresponding series of recorded workshops including: (1) Introduction to Spatial Analysis for Opioid Risk Environments, (2) Geocoding and Linking Community Data, and (3) Developing Custom Spatial Access Metrics
Calculating Spatial Access Metrics in Py
We developed geocomputational notebooks using Python for calculating, visualizing, merging, and/or writing spatial access measures. This spatial feature engineering was also used to generate many of the spatial access metrics available in OEPS. We include pre-computer travel time matrices for the country as key components to each approach, as well as sample data from OEPS for exploration and replication purposes. Both 2010 and 2020 Census vintage is supported.
- Calculate travel time to nearest resource: This notebook provides an overview of how to calculate two spatial access metrics, travel time to the nearest resource and count of resources within a customizable driving time range. Using this beginner-friendly script available as a Google Colab notebook, calculate travel time access metrics for different modes of transit and spatial scales.
- Calculate gravity model estimates for one state: Gravity model estimates incorporate both supply (resources) and demand (people), better accounting for population distributions in varying service needs. This notebook can be calculated on Colab and most analytic machines.
- Calculate gravity model estimates for country: To scale things up, this notebook can generate nation-wide estimates of gravity model measures with the aid of high performance computing environment.
Additional Resources
Geospatial Consortium & Community of Practice (GCCP)
The GCCP, launched in 2025, is a collaboration of researchers and practitioners that meet regularly to share, discuss, and learn how geospatial methods, tools, and models can be used to build understanding and develop resources for the opioid epidemic. As part of the JCOIN Community, we focus on justice populations, though we’ll also be seeking how to measure and model multiple communities & places across the U.S. To do that, we’ll be linking fields across epidemiology, medicine, geography, GIS, data science, and more. Learn more and sign up at the GCCP Website.
SDOH & Place Project
Looking for even more coding resources and data options to better measure and understand the social determinants of health (SDOH) and structural drivers of wellbeing? The SDOH & Place project provides multiple resources and a community of practice. Learn how to develop your own spatial web mapping application or dashboard. Uncover dozens of new SDOH datasets across multiple spatial scales at the Data Discovery Tool.
US COVID Atlas
For historical Pandemic data, resources have been moved to the US COVID Atlas, a historic, interactive data visualization platform and archive. The Atlas worked to understand, represent, and share stories of the often unequal impact of the COVID-19 pandemic in the United States, from January 2020 through the end of 2023. Data includes daily and weekly case counts, vaccination rates, and community health contexts. Read more and explore at USCovidAtlas.org.