restart equity git
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
UTF-8
|
||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,143 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><metadata>
|
||||||
|
<idinfo>
|
||||||
|
<citation>
|
||||||
|
<citeinfo>
|
||||||
|
<title>California State Assembly Districts Map 2020</title>
|
||||||
|
<onlink>https://services3.arcgis.com/uknczv4rpevve42E/arcgis/rest/services/California_State_Assembly_Districts_Map_2020/FeatureServer</onlink>
|
||||||
|
</citeinfo>
|
||||||
|
</citation>
|
||||||
|
<descript>
|
||||||
|
<abstract>Final approved map by the 2020 California Citizens Redistricting Commission for the California State Assembly; the authoritative and official delineations of the California State Assembly drawn during the 2020 redistricting cycle. The Citizens Redistricting Commission for the State of California has created statewide district maps for the State Assembly, State Senate, State Board of Equalization, and United States Congress in accordance, with the provisions of Article XXI of the California Constitution. The Commission has approved the final maps and certified them to the Secretary of State.Line drawing criteria included population equality as required by the U.S. Constitution, the Federal Voting Rights Act, geographic contiguity, geographic integrity, geographic compactness, and nesting. Geography was defined by U.S. Census Block geometry.80 Assembly districts have an ideal population of around 500,000 people each, and in consideration of population equality, the Commission chose to limit the population deviation range to as close to zero percent as practicable. With these districts, the Commission was able to respect many local communities of interest and group similar communities; however, it was more difficult to keep densely populated counties, cities, neighborhoods, and larger communities of interest whole due to the district size and correspondingly smaller number allowable in the population deviation percentage.</abstract>
|
||||||
|
<purpose>Final approved map by the 2020 California Citizens Redistricting Commission for the California State Assembly.</purpose>
|
||||||
|
</descript>
|
||||||
|
<keywords>
|
||||||
|
<theme>
|
||||||
|
<themekt>None</themekt>
|
||||||
|
<themekey>California State Assembly Districts Map 2020</themekey>
|
||||||
|
</theme>
|
||||||
|
</keywords>
|
||||||
|
<accconst>Other Constraints</accconst>
|
||||||
|
<useconst>None</useconst>
|
||||||
|
<datacred>2020 California Citizens Redistricting Commission (CRC)</datacred>
|
||||||
|
</idinfo>
|
||||||
|
<eainfo>
|
||||||
|
<detailed>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>AREA</attrlabl>
|
||||||
|
<attrdef>Area of the district in sq miles</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>DISTRICT</attrlabl>
|
||||||
|
<attrdef>Assigned District number</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>MEMBERS</attrlabl>
|
||||||
|
<attrdef>Maptitude-generated field; allows user to assign member to district</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>LOCKED</attrlabl>
|
||||||
|
<attrdef>Maptitude-generated field; Locked geography</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>NAME</attrlabl>
|
||||||
|
<attrdef>District Name</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>POPULATION</attrlabl>
|
||||||
|
<attrdef>Total Persons</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>CVAP_19</attrlabl>
|
||||||
|
<attrdef>Citizens Voting Age Population, as estimated by the American Communities Survey 2019</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>HSP_CVAP_1</attrlabl>
|
||||||
|
<attrdef>Citizen Voting Age Population: Hispanic or Latino</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>DOJ_NH_BLK</attrlabl>
|
||||||
|
<attrdef>Race (non-Hispanic): DOJ (Federal Register 1/18/2001) Summary: Black (including Black and White)|2020 PL94-171:P0020006 + P0020013</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>DOJ_NH_ASN</attrlabl>
|
||||||
|
<attrdef>Race (non-Hispanic): DOJ (Federal Register 1/18/2001) Summary: Asian (including Asian and White)|2020 PL94-171:P0020008 + P0020015</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>NH_WHT_CVA</attrlabl>
|
||||||
|
<attrdef>Citizen Voting Age Population: Not Hispanic or Latino: White Alone</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>IDEAL_VALU</attrlabl>
|
||||||
|
<attrdef>Ideal district population (total population/number of total districts)</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>DEVIATION</attrlabl>
|
||||||
|
<attrdef>Deviation from ideal district size (in number of persons)</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>F_DEVIATIO</attrlabl>
|
||||||
|
<attrdef>% Deviation (district population/ideal district size)</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>F_CVAP_19</attrlabl>
|
||||||
|
<attrdef>% Citizen Voting Age Population: Total</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>F_HSP_CVAP</attrlabl>
|
||||||
|
<attrdef>% Citizen Voting Age Population: Hispanic or Latino</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>F_DOJ_NH_B</attrlabl>
|
||||||
|
<attrdef>% Citizen Voting Age Population: Not Hispanic or Latino: Black or African American Alone</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>F_DOJ_NH_A</attrlabl>
|
||||||
|
<attrdef>% Citizen Voting Age Population: Not Hispanic or Latino: Asian Alone</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>F_NH_WHT_C</attrlabl>
|
||||||
|
<attrdef>% Citizen Voting Age Population: Not Hispanic or Latino: White Alone</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>DISTRICT_N</attrlabl>
|
||||||
|
<attrdef>District Number</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
<attr>
|
||||||
|
<attrlabl>DISTRICT_L</attrlabl>
|
||||||
|
<attrdef>District Label: displays district number and % deviation</attrdef>
|
||||||
|
<attrdefs>2020 California Citizens Redistricting Commission (CRC)</attrdefs>
|
||||||
|
</attr>
|
||||||
|
</detailed>
|
||||||
|
</eainfo>
|
||||||
|
<metainfo>
|
||||||
|
<metd>20230214</metd>
|
||||||
|
<metc>
|
||||||
|
<cntinfo>
|
||||||
|
<!--no contact person or organization name available-->
|
||||||
|
</cntinfo>
|
||||||
|
</metc>
|
||||||
|
<metstdn>FGDC Content Standard for Digital Geospatial Metadata</metstdn>
|
||||||
|
<metstdv>FGDC-STD-001-1998</metstdv>
|
||||||
|
<mettc>local time</mettc>
|
||||||
|
</metainfo>
|
||||||
|
</metadata>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
california_enviroscreen/calenviroscreen40gdb_F_2021.gdb/gdb
Normal file
BIN
california_enviroscreen/calenviroscreen40gdb_F_2021.gdb/gdb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
UTF-8
|
||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
PROJCS["NAD_1983_California_Teale_Albers",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",-4000000.0],PARAMETER["Central_Meridian",-120.0],PARAMETER["Standard_Parallel_1",34.0],PARAMETER["Standard_Parallel_2",40.5],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
554
california_enviroscreen/enviroscreen_to_postgis.ipynb
Normal file
554
california_enviroscreen/enviroscreen_to_postgis.ipynb
Normal file
@@ -0,0 +1,554 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 1,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"## read california enviroscreen data gbd file and save to postgis\n",
|
||||||
|
"## 2024-09-22"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 14,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"## set directory\n",
|
||||||
|
"import os\n",
|
||||||
|
"os.chdir('/home/dadams/Repos/california_equity_git/')"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 3,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"# import libraries\n",
|
||||||
|
"import pandas as pd\n",
|
||||||
|
"import geopandas as gpd\n",
|
||||||
|
"from sqlalchemy import create_engine\n",
|
||||||
|
"\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 18,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import geopandas as gpd\n",
|
||||||
|
"\n",
|
||||||
|
"# Read in data\n",
|
||||||
|
"data = gpd.read_file('california_enviroscreen/calenviroscreen40gdb_F_2021.gdb')\n",
|
||||||
|
"\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 19,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/html": [
|
||||||
|
"<div>\n",
|
||||||
|
"<style scoped>\n",
|
||||||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||||||
|
" vertical-align: middle;\n",
|
||||||
|
" }\n",
|
||||||
|
"\n",
|
||||||
|
" .dataframe tbody tr th {\n",
|
||||||
|
" vertical-align: top;\n",
|
||||||
|
" }\n",
|
||||||
|
"\n",
|
||||||
|
" .dataframe thead th {\n",
|
||||||
|
" text-align: right;\n",
|
||||||
|
" }\n",
|
||||||
|
"</style>\n",
|
||||||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||||||
|
" <thead>\n",
|
||||||
|
" <tr style=\"text-align: right;\">\n",
|
||||||
|
" <th></th>\n",
|
||||||
|
" <th>Tract</th>\n",
|
||||||
|
" <th>ZIP</th>\n",
|
||||||
|
" <th>Population</th>\n",
|
||||||
|
" <th>CIscore</th>\n",
|
||||||
|
" <th>CIscoreP</th>\n",
|
||||||
|
" <th>Ozone</th>\n",
|
||||||
|
" <th>Ozone_Pctl</th>\n",
|
||||||
|
" <th>PM2_5</th>\n",
|
||||||
|
" <th>PM2_5_Pctl</th>\n",
|
||||||
|
" <th>Diesel_PM</th>\n",
|
||||||
|
" <th>...</th>\n",
|
||||||
|
" <th>African_American</th>\n",
|
||||||
|
" <th>Native_American</th>\n",
|
||||||
|
" <th>Asian_American</th>\n",
|
||||||
|
" <th>Pacific_Islander</th>\n",
|
||||||
|
" <th>Other_Multiple</th>\n",
|
||||||
|
" <th>Shape_Length</th>\n",
|
||||||
|
" <th>Shape_Area</th>\n",
|
||||||
|
" <th>County</th>\n",
|
||||||
|
" <th>ApproxLoc</th>\n",
|
||||||
|
" <th>geometry</th>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </thead>\n",
|
||||||
|
" <tbody>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>0</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93454</td>\n",
|
||||||
|
" <td>4495</td>\n",
|
||||||
|
" <td>36.019653</td>\n",
|
||||||
|
" <td>69.162885</td>\n",
|
||||||
|
" <td>0.034190</td>\n",
|
||||||
|
" <td>10.566273</td>\n",
|
||||||
|
" <td>7.567724</td>\n",
|
||||||
|
" <td>10.031114</td>\n",
|
||||||
|
" <td>0.154573</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.4004</td>\n",
|
||||||
|
" <td>0.2670</td>\n",
|
||||||
|
" <td>8.2091</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>1.3126</td>\n",
|
||||||
|
" <td>6999.357622</td>\n",
|
||||||
|
" <td>2.847611e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Santa Maria</td>\n",
|
||||||
|
" <td>MULTIPOLYGON (((-39795.070 -341919.191, -38126...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>1</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93455</td>\n",
|
||||||
|
" <td>13173</td>\n",
|
||||||
|
" <td>37.030667</td>\n",
|
||||||
|
" <td>70.637922</td>\n",
|
||||||
|
" <td>0.035217</td>\n",
|
||||||
|
" <td>11.561917</td>\n",
|
||||||
|
" <td>7.624775</td>\n",
|
||||||
|
" <td>10.454263</td>\n",
|
||||||
|
" <td>0.106088</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>2.5051</td>\n",
|
||||||
|
" <td>0.0000</td>\n",
|
||||||
|
" <td>4.6990</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>0.9489</td>\n",
|
||||||
|
" <td>19100.578003</td>\n",
|
||||||
|
" <td>1.635292e+07</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Santa Maria</td>\n",
|
||||||
|
" <td>MULTIPOLYGON (((-39795.070 -341919.191, -39803...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>2</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93454</td>\n",
|
||||||
|
" <td>2398</td>\n",
|
||||||
|
" <td>31.213140</td>\n",
|
||||||
|
" <td>61.069087</td>\n",
|
||||||
|
" <td>0.034190</td>\n",
|
||||||
|
" <td>10.566273</td>\n",
|
||||||
|
" <td>7.548835</td>\n",
|
||||||
|
" <td>9.931549</td>\n",
|
||||||
|
" <td>0.190474</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.9591</td>\n",
|
||||||
|
" <td>0.0000</td>\n",
|
||||||
|
" <td>0.5421</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>2.1685</td>\n",
|
||||||
|
" <td>4970.985933</td>\n",
|
||||||
|
" <td>1.352330e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Santa Maria</td>\n",
|
||||||
|
" <td>MULTIPOLYGON (((-38115.747 -341130.248, -38126...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>3</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93455</td>\n",
|
||||||
|
" <td>4496</td>\n",
|
||||||
|
" <td>6.639331</td>\n",
|
||||||
|
" <td>5.988401</td>\n",
|
||||||
|
" <td>0.036244</td>\n",
|
||||||
|
" <td>13.615432</td>\n",
|
||||||
|
" <td>7.660570</td>\n",
|
||||||
|
" <td>10.653391</td>\n",
|
||||||
|
" <td>0.091384</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.9342</td>\n",
|
||||||
|
" <td>0.7117</td>\n",
|
||||||
|
" <td>3.6699</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>2.5356</td>\n",
|
||||||
|
" <td>6558.956142</td>\n",
|
||||||
|
" <td>2.417717e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Orcutt</td>\n",
|
||||||
|
" <td>MULTIPOLYGON (((-37341.662 -348530.437, -37252...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>4</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93455</td>\n",
|
||||||
|
" <td>4008</td>\n",
|
||||||
|
" <td>14.022852</td>\n",
|
||||||
|
" <td>23.121533</td>\n",
|
||||||
|
" <td>0.036244</td>\n",
|
||||||
|
" <td>13.615432</td>\n",
|
||||||
|
" <td>7.663210</td>\n",
|
||||||
|
" <td>10.690728</td>\n",
|
||||||
|
" <td>0.050976</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.6986</td>\n",
|
||||||
|
" <td>1.4721</td>\n",
|
||||||
|
" <td>3.2685</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>1.3723</td>\n",
|
||||||
|
" <td>6570.368642</td>\n",
|
||||||
|
" <td>2.608422e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Orcutt</td>\n",
|
||||||
|
" <td>MULTIPOLYGON (((-39465.107 -348499.262, -38244...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </tbody>\n",
|
||||||
|
"</table>\n",
|
||||||
|
"<p>5 rows × 68 columns</p>\n",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
" Tract ZIP Population CIscore CIscoreP Ozone \\\n",
|
||||||
|
"0 6.083002e+09 93454 4495 36.019653 69.162885 0.034190 \n",
|
||||||
|
"1 6.083002e+09 93455 13173 37.030667 70.637922 0.035217 \n",
|
||||||
|
"2 6.083002e+09 93454 2398 31.213140 61.069087 0.034190 \n",
|
||||||
|
"3 6.083002e+09 93455 4496 6.639331 5.988401 0.036244 \n",
|
||||||
|
"4 6.083002e+09 93455 4008 14.022852 23.121533 0.036244 \n",
|
||||||
|
"\n",
|
||||||
|
" Ozone_Pctl PM2_5 PM2_5_Pctl Diesel_PM ... African_American \\\n",
|
||||||
|
"0 10.566273 7.567724 10.031114 0.154573 ... 0.4004 \n",
|
||||||
|
"1 11.561917 7.624775 10.454263 0.106088 ... 2.5051 \n",
|
||||||
|
"2 10.566273 7.548835 9.931549 0.190474 ... 0.9591 \n",
|
||||||
|
"3 13.615432 7.660570 10.653391 0.091384 ... 0.9342 \n",
|
||||||
|
"4 13.615432 7.663210 10.690728 0.050976 ... 0.6986 \n",
|
||||||
|
"\n",
|
||||||
|
" Native_American Asian_American Pacific_Islander Other_Multiple \\\n",
|
||||||
|
"0 0.2670 8.2091 0.0 1.3126 \n",
|
||||||
|
"1 0.0000 4.6990 0.0 0.9489 \n",
|
||||||
|
"2 0.0000 0.5421 0.0 2.1685 \n",
|
||||||
|
"3 0.7117 3.6699 0.0 2.5356 \n",
|
||||||
|
"4 1.4721 3.2685 0.0 1.3723 \n",
|
||||||
|
"\n",
|
||||||
|
" Shape_Length Shape_Area County ApproxLoc \\\n",
|
||||||
|
"0 6999.357622 2.847611e+06 Santa Barbara Santa Maria \n",
|
||||||
|
"1 19100.578003 1.635292e+07 Santa Barbara Santa Maria \n",
|
||||||
|
"2 4970.985933 1.352330e+06 Santa Barbara Santa Maria \n",
|
||||||
|
"3 6558.956142 2.417717e+06 Santa Barbara Orcutt \n",
|
||||||
|
"4 6570.368642 2.608422e+06 Santa Barbara Orcutt \n",
|
||||||
|
"\n",
|
||||||
|
" geometry \n",
|
||||||
|
"0 MULTIPOLYGON (((-39795.070 -341919.191, -38126... \n",
|
||||||
|
"1 MULTIPOLYGON (((-39795.070 -341919.191, -39803... \n",
|
||||||
|
"2 MULTIPOLYGON (((-38115.747 -341130.248, -38126... \n",
|
||||||
|
"3 MULTIPOLYGON (((-37341.662 -348530.437, -37252... \n",
|
||||||
|
"4 MULTIPOLYGON (((-39465.107 -348499.262, -38244... \n",
|
||||||
|
"\n",
|
||||||
|
"[5 rows x 68 columns]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 19,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# show data\n",
|
||||||
|
"data.head()\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 20,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from sqlalchemy import create_engine\n",
|
||||||
|
"\n",
|
||||||
|
"# Connect to the database\n",
|
||||||
|
"engine = create_engine('postgresql://postgres:MandyLinkToby3@localhost:5432/calif_equity')\n",
|
||||||
|
"\n",
|
||||||
|
"# Save the GeoDataFrame as a PostGIS table\n",
|
||||||
|
"data.to_postgis('calenviroscreen', con=engine, if_exists='replace', index=False)\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 21,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/html": [
|
||||||
|
"<div>\n",
|
||||||
|
"<style scoped>\n",
|
||||||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||||||
|
" vertical-align: middle;\n",
|
||||||
|
" }\n",
|
||||||
|
"\n",
|
||||||
|
" .dataframe tbody tr th {\n",
|
||||||
|
" vertical-align: top;\n",
|
||||||
|
" }\n",
|
||||||
|
"\n",
|
||||||
|
" .dataframe thead th {\n",
|
||||||
|
" text-align: right;\n",
|
||||||
|
" }\n",
|
||||||
|
"</style>\n",
|
||||||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||||||
|
" <thead>\n",
|
||||||
|
" <tr style=\"text-align: right;\">\n",
|
||||||
|
" <th></th>\n",
|
||||||
|
" <th>Tract</th>\n",
|
||||||
|
" <th>ZIP</th>\n",
|
||||||
|
" <th>Population</th>\n",
|
||||||
|
" <th>CIscore</th>\n",
|
||||||
|
" <th>CIscoreP</th>\n",
|
||||||
|
" <th>Ozone</th>\n",
|
||||||
|
" <th>Ozone_Pctl</th>\n",
|
||||||
|
" <th>PM2_5</th>\n",
|
||||||
|
" <th>PM2_5_Pctl</th>\n",
|
||||||
|
" <th>Diesel_PM</th>\n",
|
||||||
|
" <th>...</th>\n",
|
||||||
|
" <th>African_American</th>\n",
|
||||||
|
" <th>Native_American</th>\n",
|
||||||
|
" <th>Asian_American</th>\n",
|
||||||
|
" <th>Pacific_Islander</th>\n",
|
||||||
|
" <th>Other_Multiple</th>\n",
|
||||||
|
" <th>Shape_Length</th>\n",
|
||||||
|
" <th>Shape_Area</th>\n",
|
||||||
|
" <th>County</th>\n",
|
||||||
|
" <th>ApproxLoc</th>\n",
|
||||||
|
" <th>geometry</th>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </thead>\n",
|
||||||
|
" <tbody>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>0</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93454</td>\n",
|
||||||
|
" <td>4495</td>\n",
|
||||||
|
" <td>36.019653</td>\n",
|
||||||
|
" <td>69.162885</td>\n",
|
||||||
|
" <td>0.034190</td>\n",
|
||||||
|
" <td>10.566273</td>\n",
|
||||||
|
" <td>7.567724</td>\n",
|
||||||
|
" <td>10.031114</td>\n",
|
||||||
|
" <td>0.154573</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.4004</td>\n",
|
||||||
|
" <td>0.2670</td>\n",
|
||||||
|
" <td>8.2091</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>1.3126</td>\n",
|
||||||
|
" <td>6999.357622</td>\n",
|
||||||
|
" <td>2.847611e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Santa Maria</td>\n",
|
||||||
|
" <td>0106000020EE0C00000100000001030000000100000009...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>1</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93455</td>\n",
|
||||||
|
" <td>13173</td>\n",
|
||||||
|
" <td>37.030667</td>\n",
|
||||||
|
" <td>70.637922</td>\n",
|
||||||
|
" <td>0.035217</td>\n",
|
||||||
|
" <td>11.561917</td>\n",
|
||||||
|
" <td>7.624775</td>\n",
|
||||||
|
" <td>10.454263</td>\n",
|
||||||
|
" <td>0.106088</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>2.5051</td>\n",
|
||||||
|
" <td>0.0000</td>\n",
|
||||||
|
" <td>4.6990</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>0.9489</td>\n",
|
||||||
|
" <td>19100.578003</td>\n",
|
||||||
|
" <td>1.635292e+07</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Santa Maria</td>\n",
|
||||||
|
" <td>0106000020EE0C00000100000001030000000100000013...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>2</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93454</td>\n",
|
||||||
|
" <td>2398</td>\n",
|
||||||
|
" <td>31.213140</td>\n",
|
||||||
|
" <td>61.069087</td>\n",
|
||||||
|
" <td>0.034190</td>\n",
|
||||||
|
" <td>10.566273</td>\n",
|
||||||
|
" <td>7.548835</td>\n",
|
||||||
|
" <td>9.931549</td>\n",
|
||||||
|
" <td>0.190474</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.9591</td>\n",
|
||||||
|
" <td>0.0000</td>\n",
|
||||||
|
" <td>0.5421</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>2.1685</td>\n",
|
||||||
|
" <td>4970.985933</td>\n",
|
||||||
|
" <td>1.352330e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Santa Maria</td>\n",
|
||||||
|
" <td>0106000020EE0C00000100000001030000000100000006...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>3</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93455</td>\n",
|
||||||
|
" <td>4496</td>\n",
|
||||||
|
" <td>6.639331</td>\n",
|
||||||
|
" <td>5.988401</td>\n",
|
||||||
|
" <td>0.036244</td>\n",
|
||||||
|
" <td>13.615432</td>\n",
|
||||||
|
" <td>7.660570</td>\n",
|
||||||
|
" <td>10.653391</td>\n",
|
||||||
|
" <td>0.091384</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.9342</td>\n",
|
||||||
|
" <td>0.7117</td>\n",
|
||||||
|
" <td>3.6699</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>2.5356</td>\n",
|
||||||
|
" <td>6558.956142</td>\n",
|
||||||
|
" <td>2.417717e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Orcutt</td>\n",
|
||||||
|
" <td>0106000020EE0C0000010000000103000000010000000D...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>4</th>\n",
|
||||||
|
" <td>6.083002e+09</td>\n",
|
||||||
|
" <td>93455</td>\n",
|
||||||
|
" <td>4008</td>\n",
|
||||||
|
" <td>14.022852</td>\n",
|
||||||
|
" <td>23.121533</td>\n",
|
||||||
|
" <td>0.036244</td>\n",
|
||||||
|
" <td>13.615432</td>\n",
|
||||||
|
" <td>7.663210</td>\n",
|
||||||
|
" <td>10.690728</td>\n",
|
||||||
|
" <td>0.050976</td>\n",
|
||||||
|
" <td>...</td>\n",
|
||||||
|
" <td>0.6986</td>\n",
|
||||||
|
" <td>1.4721</td>\n",
|
||||||
|
" <td>3.2685</td>\n",
|
||||||
|
" <td>0.0</td>\n",
|
||||||
|
" <td>1.3723</td>\n",
|
||||||
|
" <td>6570.368642</td>\n",
|
||||||
|
" <td>2.608422e+06</td>\n",
|
||||||
|
" <td>Santa Barbara</td>\n",
|
||||||
|
" <td>Orcutt</td>\n",
|
||||||
|
" <td>0106000020EE0C00000100000001030000000100000007...</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </tbody>\n",
|
||||||
|
"</table>\n",
|
||||||
|
"<p>5 rows × 68 columns</p>\n",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
" Tract ZIP Population CIscore CIscoreP Ozone \\\n",
|
||||||
|
"0 6.083002e+09 93454 4495 36.019653 69.162885 0.034190 \n",
|
||||||
|
"1 6.083002e+09 93455 13173 37.030667 70.637922 0.035217 \n",
|
||||||
|
"2 6.083002e+09 93454 2398 31.213140 61.069087 0.034190 \n",
|
||||||
|
"3 6.083002e+09 93455 4496 6.639331 5.988401 0.036244 \n",
|
||||||
|
"4 6.083002e+09 93455 4008 14.022852 23.121533 0.036244 \n",
|
||||||
|
"\n",
|
||||||
|
" Ozone_Pctl PM2_5 PM2_5_Pctl Diesel_PM ... African_American \\\n",
|
||||||
|
"0 10.566273 7.567724 10.031114 0.154573 ... 0.4004 \n",
|
||||||
|
"1 11.561917 7.624775 10.454263 0.106088 ... 2.5051 \n",
|
||||||
|
"2 10.566273 7.548835 9.931549 0.190474 ... 0.9591 \n",
|
||||||
|
"3 13.615432 7.660570 10.653391 0.091384 ... 0.9342 \n",
|
||||||
|
"4 13.615432 7.663210 10.690728 0.050976 ... 0.6986 \n",
|
||||||
|
"\n",
|
||||||
|
" Native_American Asian_American Pacific_Islander Other_Multiple \\\n",
|
||||||
|
"0 0.2670 8.2091 0.0 1.3126 \n",
|
||||||
|
"1 0.0000 4.6990 0.0 0.9489 \n",
|
||||||
|
"2 0.0000 0.5421 0.0 2.1685 \n",
|
||||||
|
"3 0.7117 3.6699 0.0 2.5356 \n",
|
||||||
|
"4 1.4721 3.2685 0.0 1.3723 \n",
|
||||||
|
"\n",
|
||||||
|
" Shape_Length Shape_Area County ApproxLoc \\\n",
|
||||||
|
"0 6999.357622 2.847611e+06 Santa Barbara Santa Maria \n",
|
||||||
|
"1 19100.578003 1.635292e+07 Santa Barbara Santa Maria \n",
|
||||||
|
"2 4970.985933 1.352330e+06 Santa Barbara Santa Maria \n",
|
||||||
|
"3 6558.956142 2.417717e+06 Santa Barbara Orcutt \n",
|
||||||
|
"4 6570.368642 2.608422e+06 Santa Barbara Orcutt \n",
|
||||||
|
"\n",
|
||||||
|
" geometry \n",
|
||||||
|
"0 0106000020EE0C00000100000001030000000100000009... \n",
|
||||||
|
"1 0106000020EE0C00000100000001030000000100000013... \n",
|
||||||
|
"2 0106000020EE0C00000100000001030000000100000006... \n",
|
||||||
|
"3 0106000020EE0C0000010000000103000000010000000D... \n",
|
||||||
|
"4 0106000020EE0C00000100000001030000000100000007... \n",
|
||||||
|
"\n",
|
||||||
|
"[5 rows x 68 columns]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 21,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# verify data\n",
|
||||||
|
"sql = 'SELECT * FROM calenviroscreen LIMIT 5;'\n",
|
||||||
|
"pd.read_sql(sql, engine)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 23,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"# close connection\n",
|
||||||
|
"engine.dispose()\n",
|
||||||
|
"\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "spatial_modeling",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.9.19"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 2
|
||||||
|
}
|
||||||
333450
data_merged/merged_california_climate_investment.csv
Normal file
333450
data_merged/merged_california_climate_investment.csv
Normal file
File diff suppressed because it is too large
Load Diff
392805
data_raw/cci_programs_data.csv
Normal file
392805
data_raw/cci_programs_data.csv
Normal file
File diff suppressed because one or more lines are too long
BIN
data_raw/cci_programs_data.xlsx
Normal file
BIN
data_raw/cci_programs_data.xlsx
Normal file
Binary file not shown.
785
initial_view/merge_cci_califequity_postgis.ipynb
Normal file
785
initial_view/merge_cci_califequity_postgis.ipynb
Normal file
File diff suppressed because one or more lines are too long
830
initial_view/some_descriptives.ipynb
Normal file
830
initial_view/some_descriptives.ipynb
Normal file
File diff suppressed because one or more lines are too long
333450
merged_california_climate_investment.csv
Normal file
333450
merged_california_climate_investment.csv
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user