Skip to content

Commit ecec870

Browse files
authored
adds unit mapping functions to utilities.py
`get_spatial_data`, its helper `selector`, and `show_map` addresses edgi-govdata-archiving/ECHO-Cross-Program#64
1 parent d0466a2 commit ecec870

File tree

2 files changed

+813
-643
lines changed

2 files changed

+813
-643
lines changed

geographies.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,60 @@
1+
spatial_tables = {
2+
# HUC8
3+
"Watershed": dict(
4+
table_name="wbdhu8",
5+
id_field="huc8"
6+
),
7+
8+
"HUC10 Watersheds": dict(
9+
table_name="wbdhu10",
10+
id_field="huc10"
11+
),
12+
13+
"HUC12 Watersheds": dict(
14+
table_name="wbdhu12",
15+
id_field="huc12"
16+
),
17+
18+
#"Ecoregions": dict(
19+
# table_name="eco_level3",
20+
# id_field="US_L3NAME" #e.g. Atlantic Coastal Pine Barrens
21+
#
22+
#),
23+
24+
"County": dict(
25+
table_name="tl_2019_us_county",
26+
id_field="GEOID" # four or five digit code corresponding to two digit state number (e.g. 55) and 2-3 digit county code!
27+
),
28+
29+
"Zip Code": dict(
30+
table_name="tl_2019_us_zcta510",
31+
id_field="zcta5ce10"
32+
33+
),
34+
35+
"EPA Region": dict(
36+
table_name="epa_regions",
37+
id_field="eparegion" # In the form of "Region 1", "Region 2", up to "Region 10"
38+
),
39+
40+
"State": dict(
41+
table_name = "tl_2019_us_state",
42+
id_field = "STUSPS" # e.g. MS, IA, AK
43+
),
44+
45+
"Congressional District": dict(
46+
table_name = "tl_2019_us_cd116",
47+
id_field = "GEOID" # this is the combination of the state id and the CD e.g. AR-2 = 0502
48+
)
49+
}
50+
151
region_field = {
252
'State': { "field": 'FAC_STATE' },
353
'Congressional District': { "field": 'FAC_DERIVED_CD113' },
454
'County': { "field": 'FAC_COUNTY' },
555
'Zip Code': { "field": 'FAC_ZIP' },
56+
'Watershed': { "field": 'FAC_DERIVED_HUC'},
57+
'EPA Region': { "field": 'FAC_EPA_REGION'}
658
}
759
# Commenting out these region types until implemented
860
# 'Watershed': {"field": 'FAC_DERIVED_HUC'},

0 commit comments

Comments
 (0)