Skip to content

code4sac/ndoch-asset-map-python

Repository files navigation

Code of America - NDoCH 2020

03.06_sac_lihm_choropleth

Code for Sacramento: Equity Asset Map Project

Change Log

  • 08-21-2020: Baseline Version v0.1

Introduction

This project focuses on the asset map item for the Code for America (CFA) National Day of Civic Hacking (NDocH) event; it consists of this notebook to visualize various assets within the Sacramento area. The data is sourced from various open data portals and provides the deliverables listed below.

Deliverables

  1. Asset Maps: Shared as HTML files in maps folder and within notebook
  2. Notebook: Contains all code and documentation needed for visualization
  3. Documentation: Notebook and README contains full write-up and results

Note: Data processing and maps are created using Jupyter Notebook due to its ability to visualize results effectively and efficiently. Listed below are installation instructions and more about Jupyter and Python.

CFA NDoCH

The event NDoCH instructions are shown below and specify that open data sources should be used to visualize resources available to the Sacramento community. This notebook is intended as starting point to visualize such data for further development.

Asset mapping is an integral part of empowered community building that is based on understanding the strengths and needs of diverse communities. First, use publicly available information about your locale to give a sense of the landscape and demographics. Next, research the location and availability of government programs (e.g. county health and human services offices), community based organizations (like resource centers, food banks, and legal aid clinics) or other resources that are vital to your community. Visually documenting the landscape can help identify what might make your community more equitable and accessible to all who live there.

Methodology

This notebook starts with a tutorial using Python mapping tools as a prototype, then develops asset maps for the Sacramento area. Open data sources are listed below and will be added to with additional development.

One desired outcome for this project is to develop a better understanding of publicly available data, appropriate tools and spatial analysis technique in develop the asset maps. As a result, project methodology, assumptions and results are documented in this readme.

Key project assumptions are listed below and validated through analysis and visualization of publicly available datasets. They serve as an outline for guide development of the notebook, analysis and visualizations.

Assumptions

  1. Publicly available data via open data portals are typically good quality and therefore suitable for use in generating equity/asset maps
  2. Data science tools such as Jupyter, Python and the Folium plotting package are appropriate tools to analyze, communicate and share results
  3. All selected tools are open-source software, and all analysis is repeatable, documented and reproducible to improve accessibility

Results

Asset maps are summarized below and organized into separate modules within the notebook. Each map is available as a separate HTML file in the maps folder.

Data Processing Steps

  1. Import raw data, then process it with helper functions as needed
  2. Lat/long coordinate CSV and GeoJSON formats used for analysis
  3. GeoJSON data was converted to JSON for plotting within Folium
  4. Geospatial data was plotted with helper functions
  5. Complete map is output within notebook and as separate file

Map 1: SFPD Crime Reports (2003-2018)

03.01_sfpd_reports

Map Legend

  • SFPD Crime Reports, 2003-2018 (Red Point)

Results

  1. Map served to validate Jupyter, Python and Folium for visualizations
  2. Tools were appropriate, and functions developed for use in notebook
  3. Cluster markers and map options implemented for additional use

SF Open Data

Tutorials

  1. Folium Tutorial: SFPD Crime Data
  2. Folium Example: Cluster Markers
  3. Folium Tutorial: Cluster Markers (JPYTR)
  4. Folium Tutorial: Shapefile Data (Medium)

Map 2: SACOG LIHM Communities and Sac Area Schools

03.02_plot_sac_lihm_school

Map Legend

  1. SACOG LIHM Communities, 2016 (Blue Polygon)
  2. CA Schools: Sac County, 2019-20 (Red Point)
  3. CA Schools: Amador County, 2019-20 (Green Point)
  4. CA Schools: Placer County, 2019-20 (Blue Point)
  5. CA Schools: Yolo County, 2019-20 (Orange Point)
  6. CA Schools: Yuba County, 2019-20 (Purple Point)

Results

  1. Map starts with SACOG Low Income High Minority (LIHM) Communities
  2. Sacramento area schools were filtered from CA data and added to map
  3. Map shows good access to schools within LIHM communities
  4. LIHM communities in the north and southeast may have less school access

Note: Analysis only evaluates proximity and not school quality; also, additional CA Geoportal data are listed below for future analysis.

SACOG Data

CA Geoportal Data

  1. CA Geoportal: Open Datasets
  2. CA School Locations (2019-20)
  3. CA Healthcare Shortage (Primary Care)
  4. CA Healthcare Shortage (Mental Health)
  5. CA Healthcare Shortage (Dental Care)

Map 3: SACOG LIHM Communities and Sac Area Bike Facilities

03.03_sac_lihm_bike

Map Legend

  1. SACOG LIHM Communities, 2016 (Orange Polygon)
  2. City of Sacramento Bike Facilities, 2018 (Green Line)
  3. City of Sacramento Bike Opportunity Areas, 2016 (Purple Polygon)

Results

  1. Map starts with SACOG Low Income High Minority (LIHM) Communities
  2. City of Sacramento bike facility data was added to map
  3. Map shows good access in downtown and expanding in opportunity areas
  4. LIHM communities outside of downtown may have less access to bike facilities

SACOG Data

City of Sacramento Data

  1. City of Sacramento Bike Facilities (2018)
  2. City of Sacramento Bike Opportunity Areas (2016)

Map 4: SACOG LIHM Communities and Public Transit

03.04_sac_lihm_transit

Map Legend

  1. SACOG LIHM Communities, 2016 (Orange Polygon)
  2. Sac Region High Transit Frequency Areas, 2020 (Purple Polygon)
  3. Sac Region High Quality Transit, 2017 (Green Line)

Results

  1. Map starts with SACOG Low Income High Minority (LIHM) Communities
  2. SACOG transportation quality data added to map
  3. Map shows good access in downtown and along major corridors
  4. LIHM communities outside of downtown may have less access to transit

SACOG Data

  1. Sac Region LIHM Communities (2016)
  2. Sac Region High Transit Frequency Areas (2020)
  3. Sac Region High Quality Transit (2017)

Map 5: SACOG LIHM Communities and Pollution Levels

03.05_sac_lihm_pollution

Map Legend

  1. SACOG LIHM Communities, 2016 (Orange Polygon)
  2. SACOG Air Pollution PM 2.5 Planning Areas, 2018 (Purple Polygon)
  3. SACOG CalEnviroScreen 3.0, Top 25% Tracts (Green Line)

Results

  1. Map starts with SACOG Low Income High Minority (LIHM) Communities
  2. SACOG pollution level data was added to map
  3. Some LIHM communities are within CalEnviroScreen areas
  4. Most of Sacramento area is within the PM 2.5 pollution planning area
  5. Additional analysis needed to evaluate CalEnviroScreen overlap

SACOG Data

  1. Sac Region LIHM Communities (2016)
  2. SACOG Air Pollution PM 2.5 Planning Areas, 2018
  3. SACOG CalEnviroScreen 3.0, Top 25% Tracts

Jupyter Installation

  1. Download and install Jupyter Notebook from their website
  2. Verify that Jupyter Notebook was installed and visible from Windows Start menu
  3. Start Jupyter Notebook; it will start CMD shell and load in the web browser
  4. Save this notebook and CSV data to your "Documents" folder and navigate to it from the Notebook start page
  5. Open this notebook from the start page; file and cells should be viewable

Jupyter Introduction

This notebook will require some basic understanding of the Python programming language, Jupyter platform and data analysis concepts. It is based on this tutorial and Github Repo.

Jupyter is a powerful collaborative tool which is open-source and light-weight. It provides all the tools necessary to run data analysis, visualization, statistics and data science out of the box. In addition, it has gain acceptance from industry and academia for collaborating on projects and publishing work.

Jupyter is a combination of text and code with the programming run-time built into the platform so there is no need to install additional software. The text is in the markdown file format (similar to HTML), and code in several languages. It is organized by cells which can consist of either text or code; placed together, they can be sent as a single document to share/publish work.

Jupyter Notebook

Notebooks are organized by cells, which mainly consist of text (in markdown) and code (Python). It operations like a hybrid between MS Word and Excel file; whereas the entire file is like a document, the cells operate like a spreadsheet. For getting started, feel free to scroll down each cell and navigate around the cells for a quick tour. Here is a breakdown of how to view/edit cells:

Navigation

  1. Each cell may be edited by hitting ENTER; toggle between cells using the arrow keys or mouse/scroller
  2. When editing a cell, be sure to select "markdown" for text or "code" before writing into it
  3. Each cell can be run by hitting CTRL + ENTER or the "run" button form the menu bar
  4. Output from each cell will appear below; if an error occurs, please read and try to debug it(!)
  5. File can be saved by hitting CTRL + "s" or file/save from the pulldown menu above

Quick Start

Notes

  1. This notebook will require some Python programming
  2. It is widely used and taught in high school and AP Computer Science courses
  3. Jupyter supports many other languages, including R, Scala and Julia
  4. Python is the most popular of them and can be used for other tasks, primarily data science and web applications

Exercises

Jupyter

  1. Intro Guide (DataQuest)
  2. Intro Guide (DataCamp)
  3. Notebook Intro (Medium)
  4. Data Science Tutorial (Jupyter)

Python

  1. Quick Start
  2. Intro Tutorials
  3. Quick Start (FCC)

Markdown

  1. Quick Start (Github)
  2. Quick Start Guide (Markdown)
  3. Quick Start Tutorial (Markdown)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published