Identifying Hot Spots for Substance User Disorder (SUD) Treatment-Eligible Populations in Los Angeles County, 2015 Ricardo A Contreras, MPH, MA. Geography.

Slides:



Advertisements
Similar presentations
Concepts of Maintaining Your Data Simple Ways to Edit Your Data By Lorne Woods.
Advertisements

Creating Map Books ArcMap 10 Data Driven Pages
Map Making Made Easy in ArcGIS
MIDTERM Effective graphical representation of data seeks to inform an audience in a clear, simplistic manner. Your layouts will be evaluated on the basis.
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Geographic Access to Primary Care Physicians in New Mexico Prepared for: Geog. 491(Problems) and Geog. 499 (Python programming) Fall Semester, 2014 Larry.
GIS Level 2 MIT GIS Services
ARCVIEW 3.X What is it and How to use it.. Project Table of Contents Displays all Views Displays all.dbf,.txt and.asc files Displays all Charts Displays.
Learning ArcGIS Desktop Topics Covered in Module 1 CVEN 2012 – Geomatics University of Colorado – Boulder April 2006 Alyssa McCluskey.
How have we learnt Geography in GIS-based lessons?
Layouts: Creating maps and figures using ArcMap 1 GIS for Planetary Mappers June 2012, Planetary Mappers Meeting.
Technical Workshops | Esri International User Conference San Diego, California ArcMap: Tips and Tricks Miriam Schmidts Jorge Ruiz-Valdepena July 23 – 27,
1/36. 2/36 Something cool …
The Project – Spreadsheet Design. The following is the high mark band for the spreadsheet design: The candidate has Analysed a given data set and designed.
An Introduction to The Network for a Healthy California GIS Viewer Welcome to Webinar Anthony Barnes Bhavdeep Sachdev 9:00am to 10:30am.
Introduction to ArcPy. Topics What is ArcPy? Accessing geoprocessing tools using ArcPy Writing scripts using ArcPy.
Python Map Automation: Introduction to arcpy.mapping / arcpy.mp
Copyright © 2006 by Maribeth H. Price 2-1 Chapter 2 Working with ArcMap.
ArcReader The Basics By Matthew Ziebarth IT/GIS Co-Op.
Esri UC 2014 | Technical Workshop | Python Map Automation – Beyond the Basics of arcpy.mapping Jeff Barrette Jeff Moulds.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Building Map Books.
Desktop Mapping: Building Map Books Jeff Barrette Michael Grossman.
Juanita Cano City of Sacramento Spring 2014 Geography 375.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Python Map Automation.
Esri UC 2014 | Technical Workshop | Python Map Automation – Introduction to arcpy.mapping Michael Grossman Jeff Barrette.
Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College.
Using ArcGIS Layout View
Chapter 2: The Visual Studio .NET Development Environment
Lecture 3 Interacting with Data.
Desktop Mapping: Building Map Books
Lab 1 Introduction to ArcGIS Feb 17, 2016
Geography 385 Introduction to ArcGIS Web Application Design
AMPO Annual Conference October 22, 2014
Automate ArcGIS with Python to Streamline Geographic Data Analysis
Cartography and Labeling
Hazards Planning and Risk Management INTRODUCTION TO ARCGIS
DOWNTOWN RESTAURANTS AND CRIME RELATIONSHIPS
Database Applications – Microsoft Access
Illustrating HIV/AIDS in the United States
Geography 375 Introduction to Python May 15, 2015
Illustrating HIV/AIDS in the United States
MODULE 7 Microsoft Access 2010
Managing Rosters Screener Training Module Module 5
RAD-IT Tool Training June 2017 RAD-IT Tool Training
Patterns of HIV in the Lake Victoria Region, a Spatiotemporal Analysis
Python Map Automation – Introduction to arcpy.mapping
Illustrating HIV/AIDS in the United States
Learning the Basics of ArcMap 3.3 Updated 4/27/2010
Introduction To ArcMap
Python Map Automation – Beyond the Basics of arcpy.mapping
Automating and Validating Edits
The process behind making a good thematic map
Using the QGIS Layout Manager to create
Building Map Books in ArcGIS
Presented to the System Leadership Team July 9, 2010 Robin Kay, Ph.D.
Vector Geoprocessing.
Student Registration/ Personal Needs Profile
The process behind making a good thematic map
18th Annual GeoElections Conference
Python Map Automation – Beyond the Basics of arcpy.mapping
Building Map Books in ArcGIS
MAIN MENU 1. Introduction 2. Unit Info 3. Unit Overview 4. Subtasks
Virginia Lenvik Geography 375 Spring 2013
Processing of NOAA Precipitation Data and Thematic Map Generation
Demographics of the North San Joaquin Valley
Kimberly Sparks, GISP and Evan O’Keefe
Ideal Parcels Locator Script
Geog 375 Individual Final Programming Project: Automated Thematic Maps
Desktop Mapping: Building Map Books
Presentation transcript:

Identifying Hot Spots for Substance User Disorder (SUD) Treatment-Eligible Populations in Los Angeles County, 2015 Ricardo A Contreras, MPH, MA. Geography 375, Spring 2017 American River college Sacramento, California

Goals To describe rationale for this Python Script project. To write a Python script that automates the creation of Service Planning Area (SPA)-related hot spot maps to identify where the SUD-treatment eligible populations may be statistically clustered (or statistically dispersed) in each census tract (N=2,345)) of Los Angeles County. To briefly describe major steps in the Python Script that allow for efficiency of the automation process. To briefly describe any issues during the script development that can be safely avoided in future iterations of this project. To show final output maps generated through the Python Script.

Background A planned expansion in the State of California Medi-Cal beneficiary population (adults with incomes up to 138% of the Federal Poverty Level, or FPL) will allow additional beneficiaries to qualify for publicly- funded substance use disorder (SUD) treatment services as of 07/01/2017. All substance use disorder treatment will be funded under the State of California Drug Medi-Cal Organized Delivery System (DMC-ODS) Waiver. It is estimated that between12% and 13% of adults living at or below the 138 % Federal poverty Level (FPL) are also in need of SUD treatment services. In order to plan for an increased demand of SUD treatment services, it is necessary to identify communities where DMC-ODS beneficiaries ‘in need’ of SUD services are ‘concentrated.’ Python Scripting can help create hot spots of areas with increased SUD treatment need in communities within County of Los Angeles.

Python Script Steps: Part A. This project consists of three logically associated scripts (Parts A, B, & C). Part A uses the Update Cursor, the Select Layer by Location and the Copy Features routine to update a new calculated field, 'FPL138_15pc': print "Setting my current workspace" arcpy.env.workspace = "C:\\PythonCourse_FinalPrjt" outpath = "C:\\PythonCourse_FinalPrjt\\LayerTemplates.gdb" FPL138fc = C:\\PythonCourse_FinalPrjt\\LayerTemplates.gdb\\LACounty_GIS\\LAC_FPL138_2015“ fields = ['t_138_15','FPL138_15pc'] # Example for defining the SPA 1 generic layer: SPA1 = "C:\PythonCourse_FinalPrjt\LayerTemplates.gdb\LACounty_GIS\SPA1_generic" Define SPA output layers that will contain the 138% FPL field, after applying the SelectByLocation Routine. These SPA-specific output features will exist in my project geodatabase only after running the Update Cursor and applying the arcpy.MakeFeatureLayer_management Routine. SPA1_out = "C:\PythonCourse_FinalPrjt\LayerTemplates.gdb\LACounty_GIS\SPA1_out"

Part A (cont.)

Part A (segment for SPA 1 Select Layer By Location and Copy Features Routine only) The Part A Python code on this and the previous slide demonstrate how to use the Update Cursor and apply the Make Feature Layer routine to generate eight new SPA layers (e.g., SPA1_out) that contain the correct number of census tracts whose centroids are located within the generic SPA layer (e.g., arcpy.MakeFeatureLayer_management(SPA1, "SPA1_lyr"))

The LAC_FPL138_2015 layer is the only other data layer, apart from the generic SPA feature classes, that I needed to start this project. Part A of this Python Script successfully generated eight new SPA layers, e.g., SPA1_out through SPA8_out using the SPAx_generic layers in the Make Feature Layer routine.

Python Script Steps: Part B. This project consists of three logically associated scripts (Parts A, B, & C). Part B uses the Hot Spots Stats Routine to generate eight new layers, each representing the SPA-related fixed distance band Hot Spot that searches for either clustering or dispersion of census tracts with DMC-ODS SUD treatment ‘in need’ populations (13% of all adults living at below the 138% Federal Poverty Level. Each SPA-specific Hot Spot had a specified search distance that had been pre- determine at work ArcGIS Toolbox, Spatial Statistics, Mapping Clusters, Optimized Hot Spot Analysis tool before this project was created: SPA 1 = 10 miles (52800 feet) SPA 2 = 3 miles (15840 feet) SPA 3 = 3 miles (15840 feet) SPA 4 = 1.5 miles (7920 feet) SPA 5 = 5 miles (26400 feet) SPA 6 = 2 miles (10560 feet) SPA 7 = 2 miles (10560 feet) SPA 8 = 2.5 miles (13200 feet) A complete example for SPA 1 follows in the next slide…

Python Script Steps: Hot Spot Analysis by SPA Please note: Red clusters indicate where the 13 % fraction of adults living at or below 138% FPL are most ‘concentrated.’ Identifying these urban areas will help in future allocation of substance abuse treatment and/or prevention services. Blue areas indicate where this population fraction is most dispersed, statistically. Hot Spot clusters are statistically significant (Getis-Ord Gi* statistic).

Python Script Steps: Part C. This project consists of three logically associated scripts (Parts A, B, & C). Part C automates pdf map production for the Hot Spot Analyses of the eight Service Planning Area (SPA) maps in Los Angeles County. The main task of this last script section was to zoom-in on each of the eight SPA regions and generate a specific SPA map (eight in total). It was also supposed to auto-arrange the position of city and SPA labels so that the relative position of these text elements did not “compete’ with the one region being zoomed-in. Must set up map template with appropriate layout elements before writing script. At least, the map template must include a legend with specific group layer(s), text box(es), scale and North arrow that will be included in the layout of each pdf output file. Please refer to next slides for details on this last section of my Python Script project.

Python Script Steps: Part C. Start by defining the workspace: datapath = 'C:\\PythonCourse_FinalPrjt\\' mappath = datapath + 'MyData\\Maps\\' mxd = MapDocument(datapath + 'Python_FinalPrjt.mxd') Get your list of data frames: dataframe = ListDataFrames(mxd, "DataFrame_SPAs") [0] Use the code line “For loop” to go through all SPA layers in Table of Contents. Added two layers to data frame: dataLayer = Layer(datapath + 'MyData\City_Group.lyr') AddLayer(dataframe, dataLayer, 'AUTO_ARRANGE')   legend = ListLayoutElements(mxd, 'LEGEND_ELEMENT', 'Legend') [0] dataLayer2 = Layer(datapath + 'MyData\SPA_Labels.lyr') AddLayer(dataframe, dataLayer2, 'AUTO_ARRANGE') legend = ListLayoutElements(mxd, 'LEGEND_ELEMENT', 'Legend') [0] Add a search cursor on the SPALayer and create a for loop that will help the Search Cursor go through each row in the column: field_name = ["SPA_NAME"] with arcpy.da.SearchCursor(SPALayer, field_name) as SPArows: for SPArow in SPArows: SPAName = SPArow[0] Refer to next five slides for more detail about Part C script.

The map to the left is the Hot Spot analysis map for SPA 4 (where Downtown Los Angeles is located, between Council Districts 1 and 14). The map shows clustering of census tracts with 13% SUD treatment needed populations. The mapping module in Part C of the Python Script succeeded in zooming in to each SPA area, and auto-arranging the region of interest while including the city-related labels and boundaries.

Lessons Learned (Difficulties, Tips to Avoid, etc) Be careful with indentation: Indents are very important in Python scripting, you must exercise caution and be patient to find where your indentation errors are. Just be patient and you will succeed. Wrong use of double quotes: Exercise caution identifying when you need to use double quotes to signify an object (e.g., a feature class) you are referring to in your script is a “layer” and when it is a feature class (no double quotes are needed). Data Sources: It is advised to plan ahead before starting any Python Script and identify all data sources that will be needed in different sections of your script. Obviously, each project will be different. Map Template Set Up: The mapping module used in this Python Script project manipulates map elements similarly to the way Data Driven Pages works. Being familiar, to some extent, with the latter, helped raise awareness of ways in which the map template will be represented in the final pdf output of the mapping module. Exclude any layer you are bringing into the map layout through the AddLayer routine from the map legend (if present), or it will be duplicated in your pdf output.

Bibliographic and Data References Centers for Medicare and Medicaid Services or CMS (2017). Affordable Care Act. https://www.medicaid.gov/affordable-care-act State of California Department of Health Care Services (2016). Drug Medi-Cal Organized Delivery System Waiver presentation. http://www.dhcs.ca.gov/services/rural/Documents/MHSD_MCTribIHPAnnMeet2016.pdf ESRI Developer Network. http://edndoc.esri.com/arcobjects/9.2/net/shared/geoprocessing/spatial_statistics_tools/hot_spot_analysis_getis_ord_ gi_star_spatial_statistics_.htm ESRI Pro.ArcGIS.com page. Modeling spatial relationships. http://pro.arcgis.com/en/pro-app/tool-reference/spatial-statistics/modeling-spatial-relationships.htm Jennings, Nathan (2016). A Python Primer for ArcGIS, Workbooks 1, 2 & 3. San Bernardino, California. Jennings, Nathan (2017). Python Script lesson templates for update and search cursors, and mapping module, Geography 375, Spring 2017. American River College, Sacramento, California. Los Angeles County Internal Services Department (ISD), Urban Research Unit. GIS layer for estimated number of adult persons living at or below the 138 % Federal Poverty Level in 2015; generic service planning area (SPA) layers for Los Angeles County.