Code and Analysis Resources

Code notebooks and spatial analysis tutorials for research applications

Notebooks and Sample Code

Opioid Environment Toolkit

The Opioid Environment 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, conducting a nearest distance analysis calculating straight line (Euclidean) distance metrics, and more.

Calculating Advanced Spatial Access Metrics

This Python notebook provides an overview of how to calculate two spatial access metrics, travel time to the nearest resource (i.e. MOUD provider location), 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. We provide pre-computed travel time matrices for driving, walking, and biking travel networks, for all Census tracts and zip codes (ZCTA).

Spatial Access for PySAL

Developed by CSDS researchers and colleagues, this Python Spatial Analysis Library (PySAL) package implements a new spatial access measure, Rational Agent Access Model (RAAM), that simultaneously accounts for travel time and congestion at the destination. This package also calculates five classic spatial access models for easy comparison, including Floating Catchment Areas (FCA), Two-Step FCAs, and Access Score.

Workshops and Trainings

Spatial Dimensions of Opioid Risk Environments: Virtual Workshops

This three-part workshop series hosted by the MAARC is designed to help researchers, analysts, and practitioners develop stronger spatial data analytic and visualization skills. Led by the Healthy Regions/CSDS MAARC team, these workshops introduce basic spatial analytic functionalities using open source tools, mainly in R and GeoDa, using applied examples. The workshops were originally hosted live and recorded in Summer 2021 for JCOIN partners. The complete recordings are available below.

Workshop 1: Introduction to Spatial Analysis for Opioid Risk Environments [Recording]

This workshop introduces participants to the Opioid Environment Policy Scan (OEPS data warehouse, key concepts in spatial data analysis, and generating simple maps using the free spatial software GeoDa.

Workshop 2: Geocoding and Linking Community Data [Recording]

This workshop introduces open source methods for geocoding Medication for Opioid Use Disorder (MOUD) resource locations and other address data, integrating community characteristics data using geographic identifiers, and generating maps for exploratory analysis.

Workshop 3: Developing Custom Spatial Access Metrics [Recording]

This workshop instructs how to conduct a nearest resource analysis for MOUD resources at the community level, calculate minimum distance access metrics, and generate maps overlaying resource locations and access metrics for further analysis.

Talks

Opioid Environment Policy Scan: Open data for analyzing and visualizing the opioid risk environment

This talk was presented at the American Association of Geographers (AAG) Annual Conference in February 2022 by Susan Paykin. It contextualizes the risk environment framework and outlines the data and structure of the OEPS. Slides are available on GitHub.