forked from eyeseast/dc-gis-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefinitions.py
193 lines (176 loc) · 6.49 KB
/
definitions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
"""
Configuration describing the shapefiles to be loaded.
"""
import re
from datetime import date
from django.contrib.humanize.templatetags.humanize import ordinal
import utils
def district_normalizer(name):
"""
Police district names are formatted like as "Third_District",
so we need to get just the first part of that.
"""
if "_" in name:
return name.split('_')[0]
else:
return name
# This SHAPEFILES dictionary is a sample. You should delete (or comment out)
# the first entry if you don't care about neighborhoods in Chicago.
SHAPEFILES = {
'Wards': {
'file': 'Ward02Ply/Ward02Ply.shp',
'singular': 'Ward',
'kind_first': True,
'ider': utils.simple_namer(['WARD_ID']),
'namer': utils.simple_namer(['WARD_ID']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 26),
'href': 'http://data.dc.gov/Metadata.aspx?id=126',
'notes': '',
'encoding': '',
},
'Neighborhood Clusters': {
'file': 'NbhClusPly/NbhClusPly.shp',
'singular': 'Neighborhood Cluster',
'kind_first': False,
'ider': utils.simple_namer(['GIS_ID']),
'namer': utils.simple_namer(['NBH_NAMES']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 26),
'href': 'http://data.dc.gov/Metadata.aspx?id=163',
'notes': '',
'encoding': '',
},
'ANC Districts': {
'file': 'ANC02Ply/ANC02Ply.shp',
'singular': 'ANC District',
'kind_first': True,
'ider': utils.simple_namer(['GIS_ID']),
'namer': utils.simple_namer(['ANC_ID']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 26),
'href': 'http://data.dc.gov/Metadata.aspx?id=148',
'notes': '',
'encoding': '',
},
'Quadrants': {
'file': 'DcQuadPly/DcQuadPly.shp',
'singular': 'Quadrant',
'kind_first': False,
'ider': utils.simple_namer(['GIS_ID']),
'namer': utils.simple_namer(['NAME']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 26),
'href': 'http://data.dc.gov/Metadata.aspx?id=83',
'notes': '',
'encoding': '',
},
'Census Block Groups': {
'file': 'BlockGroupPly/BlockGroupPly.shp',
'singular': 'Census Block Group',
'kind_first': True,
'ider': utils.simple_namer(['BLKGRP']),
'namer': utils.simple_namer(['BLKGRP']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 26),
'href': 'http://data.dc.gov/Metadata.aspx?id=302',
'notes': '',
'encoding': '',
},
'Census Tracts': {
'file': 'TractPly/TractPly.shp',
'singular': 'Census Tract',
'kind_first': True,
'ider': utils.simple_namer(['TRACT']),
'namer': utils.simple_namer(['TRACT']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 26),
'href': 'http://data.dc.gov/Metadata.aspx?id=119',
'notes': '',
'encoding': '',
},
'Elementary School Attendance Zones': {
'file': 'ESBndyPly/ESBndyPly.shp',
'singular': 'Elementary School Attendance Zone',
'kind_first': False,
'ider': utils.simple_namer(['SCHOOLNAME']),
'namer': utils.simple_namer(['SCHOOLNAME']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 28),
'href': 'http://data.dc.gov/Metadata.aspx?id=180',
'notes': '',
'encoding': '',
},
'Middle School Attendance Zones': {
'file': 'MSBndyPly/MSBndyPly.shp',
'singular': 'Middle School Attendance Zone',
'kind_first': False,
'ider': utils.simple_namer(['SCHOOLNAME']),
'namer': utils.simple_namer(['SCHOOLNAME']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 28),
'href': 'http://data.dc.gov/Metadata.aspx?id=181',
'notes': '',
'encoding': '',
},
'Senior High School Attendance Zones': {
'file': 'SHSBndyPly/SHSBndyPly.shp',
'singular': 'Senior High School Attendance Zone',
'kind_first': False,
'ider': utils.simple_namer(['SCHOOLNAME']),
'namer': utils.simple_namer(['SCHOOLNAME']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 2, 28),
'href': 'http://data.dc.gov/Metadata.aspx?id=63',
'notes': '',
'encoding': '',
},
'Police Districts': {
'file': 'PolDistPly/PolDistPly.shp',
'singular': 'District',
'kind_first': False,
'ider': utils.simple_namer(['GIS_ID']),
'namer': utils.simple_namer(['NAME'], normalizer=district_normalizer),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 3, 1),
'href': 'http://data.dc.gov/Metadata.aspx?id=187',
'notes': '',
'encoding': '',
},
'Police Service Areas': {
'file': 'PolSAPly/PolSAPly.shp',
'singular': 'Police Service Area',
'kind_first': True,
'ider': utils.simple_namer(['GIS_ID']),
'namer': utils.simple_namer(['NAME']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 3, 1),
'href': 'http://data.dc.gov/Metadata.aspx?id=120',
'notes': '',
'encoding': '',
},
'Zip Codes': {
'file': 'ZipCodePly/ZipCodePly.shp',
'singular': 'Zip Code',
'kind_first': True,
'ider': utils.simple_namer(['GIS_ID']),
'namer': utils.simple_namer(['ZIPCODE']),
'authority': 'DC Office of the Chief Technology Officer',
'domain': 'Washington, DC',
'last_updated': date(2011, 3, 1),
'href': 'http://data.dc.gov/Metadata.aspx?id=130',
'notes': '',
'encoding': '',
}
}