Skip to content

Commit

Permalink
File upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jmadron committed Oct 1, 2021
1 parent ceff370 commit 1c58576
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Binary file added ArcGIS_Toolbox.zip
Binary file not shown.
37 changes: 37 additions & 0 deletions Census_Data_HOLC_Polygons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-10-01 09:46:07
"""
import arcpy
from sys import argv

def HOLC(NHGIS_Census_Boundaries, HOLC_Polygons="holc_ad_data", Output_Location="C:\\Users\\jmadron\\Documents\\ArcGIS\\Projects\\Census_HOLC\\Census_HOLC.gdb\\Intersect_Dissolve", Dissolve_Field_s_=["GISJOIN", "neighborho"], Statistics_Field_s_=[["Perc", "SUM"], ["holc_grade", "FIRST"]]): # Census Data & HOLC Polygons

# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = False

arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx")

# Process: Add Fields (multiple) (Add Fields (multiple)) (management)
tracts_trim_2_ = arcpy.management.AddFields(in_table=NHGIS_Census_Boundaries, field_description=[["orig_area", "DOUBLE", "", "", "", ""], ["new_area", "DOUBLE", "", "", "", ""], ["Perc", "DOUBLE", "", "", "", ""]])[0]

# Process: Calculate Geometry Attributes (Calculate Geometry Attributes) (management)
tracts_trim_3_ = arcpy.management.CalculateGeometryAttributes(in_features=tracts_trim_2_, geometry_property=[["orig_area", "AREA_GEODESIC"]], length_unit="", area_unit="SQUARE_MILES_US", coordinate_system="PROJCS[\"USA_Contiguous_Albers_Equal_Area_Conic\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-96.0],PARAMETER[\"Standard_Parallel_1\",29.5],PARAMETER[\"Standard_Parallel_2\",45.5],PARAMETER[\"Latitude_Of_Origin\",37.5],UNIT[\"Meter\",1.0]]", coordinate_format="SAME_AS_INPUT")[0]

# Process: Intersect (Intersect) (analysis)
Intersect_3_ = "C:\\Users\\jmadron\\Documents\\ArcGIS\\Projects\\Census_HOLC\\Census_HOLC.gdb\\Intersect"
arcpy.analysis.Intersect(in_features=[[tracts_trim_2_, ""], [HOLC_Polygons, ""]], out_feature_class=Intersect_3_, join_attributes="ALL", cluster_tolerance="", output_type="INPUT")

# Process: Calculate Geometry Attributes (2) (Calculate Geometry Attributes) (management)
tracts_trim_4_ = arcpy.management.CalculateGeometryAttributes(in_features=Intersect_3_, geometry_property=[["new_area", "AREA_GEODESIC"]], length_unit="", area_unit="SQUARE_MILES_US", coordinate_system="PROJCS[\"USA_Contiguous_Albers_Equal_Area_Conic\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-96.0],PARAMETER[\"Standard_Parallel_1\",29.5],PARAMETER[\"Standard_Parallel_2\",45.5],PARAMETER[\"Latitude_Of_Origin\",37.5],UNIT[\"Meter\",1.0]]", coordinate_format="SAME_AS_INPUT")[0]

# Process: Calculate Field (Calculate Field) (management)
tracts_trim_5_ = arcpy.management.CalculateField(in_table=tracts_trim_4_, field="Perc", expression="(!new_area! / !orig_area!)", expression_type="PYTHON3", code_block="", field_type="TEXT", enforce_domains="NO_ENFORCE_DOMAINS")[0]

# Process: Dissolve (Dissolve) (management)
arcpy.management.Dissolve(in_features=Intersect_3_, out_feature_class=Output_Location, dissolve_field=Dissolve_Field_s_, statistics_fields=Statistics_Field_s_, multi_part="MULTI_PART", unsplit_lines="DISSOLVE_LINES")

if __name__ == '__main__':
# Global Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\jmadron\Documents\ArcGIS\Projects\Census_HOLC\Census_HOLC.gdb", workspace=r"C:\Users\jmadron\Documents\ArcGIS\Projects\Census_HOLC\Census_HOLC.gdb"):
HOLC(*argv[1:])
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Census_HOLC_Research
Census boundary crosswalk with HOLC Polygons


This ArcGIS Pro Toolbox and Python script allows you to crosswalk any Census boundaries (County, Tract, Block) with the Home Owner's Loan Corporation Polygons for reasearch analysis. This tool cuts the Census boundaries to the HOLC polygons and calculates a percent of that boundary that falls within the HOLC neighborhood. Assuming equal distribution you can use this percentage to proportion the variable of choice into the graded neighborhood. Below are the field you will need to populate:

Census Boundaries: Any geospatial census boundaries. Make sure these have a geoid, fips, or nhgis join code. This is used in the dissolve analysis.
HOLC Polygons: This works best with the DSL's Mapping Inequality HOLC Polygons layer. You will need the holc_grade and neighborhood_id field.

0 comments on commit 1c58576

Please sign in to comment.