]> git.openstreetmap.org Git - nominatim.git/blob - utils/tiggerAddressImport.py
804eae9cb8c08b67b1d1fa23ddcc7750f7c1ddee
[nominatim.git] / utils / tiggerAddressImport.py
1 #!/usr/bin/python
2 # Tiger road data to OSM conversion script
3 # Creates Karlsruhe-style address ways beside the main way
4 # based on the Massachusetts GIS script by christopher schmidt
5
6 #BUGS:
7 # On very tight curves, a loop may be generated in the address way.
8 # It would be nice if the ends of the address ways were not pulled back from dead ends
9
10 VERSION="0.3"
11 # Version 0.3 is optimized for the tiger road conversion
12
13 # Tag Source  = iSource + _import_v + version + _ + date and time
14 iSource="tiger"
15 # Tag Attribution = iAttrib
16 iAttrib="tiger"
17
18 # Ways that include these mtfccs should not be uploaded
19 # H1100 Connector
20 # H3010 Stream/River
21 # H3013 Braided Stream
22 # H3020 Canal, Ditch or Aqueduct
23 # L4130 Point-to-Point Line
24 # L4140 Property/Parcel Line (Including PLSS)
25 # P0001 Nonvisible Linear Legal/Statistical Boundary
26 # P0002 Perennial Shoreline
27 # P0003 Intermittent Shoreline
28 # P0004 Other non-visible bounding Edge (e.g., Census water boundary, boundary of an areal feature)
29
30
31 ignoremtfcc = [ "H1100", "H3010", "H3013", "H3020", "L4130", "L4140", "P0001", "P0002", "P0003", "P0004" ]
32
33 #Files will be split when longer than this number of nodes
34 maxNodes = 300000
35
36 # Set the maximum length of a way (in nodes) before it is split into
37 # shorter ways
38 Max_Waylength = 500
39
40 # Sets the distance that the address ways should be from the main way, in feet.
41 address_distance = 30
42
43 # Sets the distance that the ends of the address ways should be pulled back from the ends of the main way, in feet
44 address_pullback = 45
45
46 try:
47     from osgeo import ogr
48     from osgeo import osr
49 except:
50     import ogr
51     import osr
52
53 # ====================================
54 # Edit parse_shp_for_osm section to fit your data!
55 # change poFeature.GetField("    ") to contain only the shape column names for the data you want
56 # and  tags["   "] to match the osm tag names you wish to use for that data.
57 # some tags will require changing a number to a meaningful value like the Highway tag.  See the metadata for the meaning of these tags.
58 # For any measurements be sure to check the unit value of the original data, and convert if needed to the expected unit for osm.
59 # ====================================
60
61 # Long name, short name, ISO-3166-1 alpha-2
62 # from http://www.census.gov/geo/www/ansi/statetables.html
63 fipscodes = {
64     '01' : ('Alabama', 'AL', 'US'),
65     '02' : ('Alaska', 'AK', 'US'),
66     '04' : ('Arizona', 'AZ', 'US'),
67     '05' : ('Arkansas', 'AR', 'US'),
68     '06' : ('California', 'CA', 'US'),
69     '08' : ('Colorado', 'CO', 'US'),
70     '09' : ('Connecticut', 'CT', 'US'),
71     '10' : ('Delaware', 'DE', 'US'),
72     '11' : ('District of Columbia', 'DC', 'US'),
73     '12' : ('Florida', 'FL', 'US'),
74     '13' : ('Georgia', 'GA', 'US'),
75     '15' : ('Hawaii', 'HI', 'US'),
76     '16' : ('Idaho', 'ID', 'US'),
77     '17' : ('Illinois', 'IL', 'US'),
78     '18' : ('Indiana', 'IN', 'US'),
79     '19' : ('Iowa', 'IA', 'US'),
80     '20' : ('Kansas', 'KS', 'US'),
81     '21' : ('Kentucky', 'KY', 'US'),
82     '22' : ('Louisiana', 'LA', 'US'),
83     '23' : ('Maine', 'ME', 'US'),
84     '24' : ('Maryland', 'MD', 'US'),
85     '25' : ('Massachusetts', 'MA', 'US'),
86     '26' : ('Michigan', 'MI', 'US'),
87     '27' : ('Minnesota', 'MN', 'US'),
88     '28' : ('Mississippi', 'MS', 'US'),
89     '29' : ('Missouri', 'MO', 'US'),
90     '30' : ('Montana', 'MT', 'US'),
91     '31' : ('Nebraska', 'NE', 'US'),
92     '32' : ('Nevada', 'NV', 'US'),
93     '33' : ('New Hampshire', 'NH', 'US'),
94     '34' : ('New Jersey', 'NJ', 'US'),
95     '35' : ('New Mexico', 'NM', 'US'),
96     '36' : ('New York', 'NY', 'US'),
97     '37' : ('North Carolina', 'NC', 'US'),
98     '38' : ('North Dakota', 'ND', 'US'),
99     '39' : ('Ohio', 'OH', 'US'),
100     '40' : ('Oklahoma', 'OK', 'US'),
101     '41' : ('Oregon', 'OR', 'US'),
102     '42' : ('Pennsylvania', 'PA', 'US'),
103     '44' : ('Rhode Island', 'RI', 'US'),
104     '45' : ('South Carolina', 'SC', 'US'),
105     '46' : ('South Dakota', 'SD', 'US'),
106     '47' : ('Tennessee', 'TN', 'US'),
107     '48' : ('Texas', 'TX', 'US'),
108     '49' : ('Utah', 'UT', 'US'),
109     '50' : ('Vermont', 'VT', 'US'),
110     '51' : ('Virginia', 'VA', 'US'),
111     '53' : ('Washington', 'WA', 'US'),
112     '54' : ('West Virginia', 'WV', 'US'),
113     '55' : ('Wisconsin', 'WI', 'US'),
114     '56' : ('Wyoming', 'WY', 'US'),
115     # Outlying areas w/census data
116     '60' : ('American Samoa', 'AS', 'AS'),
117     '66' : ('Guam', 'GU', 'GU'),
118     '69' : ('Commonwealth of the Northern Mariana Islands', 'MP', 'MP'),
119     '72' : ('Puerto Rico', 'PR', 'PR'),
120     '78' : ('U.S. Virgin Islands', 'VI', 'VI'),
121     }
122
123 # This was generated with the following:
124 # wget http://www.census.gov/datamap/fipslist/AllSt.txt
125 # cat AllSt.txt  | grep '^                [0-9]' | awk "{printf \"'%s' : '%s' ,\\n\", \$1, substr(\$0, 31)}" | > countyfips.py
126
127 county_fips = {
128 '02000' : 'ALASKA' ,
129 '02013' : 'Aleutians East, AK' ,
130 '02016' : 'Aleutians West, AK' ,
131 '02050' : 'Bethel, AK' ,
132 '02060' : 'Bristol Bay, AK' ,
133 '02068' : 'Denali, AK' ,
134 '02070' : 'Dillingham, AK' ,
135 '02090' : 'Fairbanks North Star, AK' ,
136 '02100' : 'Haines, AK' ,
137 '02110' : 'Juneau, AK' ,
138 '02122' : 'Kenai Peninsula, AK' ,
139 '02130' : 'Ketchikan Gateway, AK' ,
140 '02150' : 'Kodiak Island, AK' ,
141 '02164' : 'Lake and Peninsula, AK' ,
142 '02170' : 'Matanuska-Susitna, AK' ,
143 '02180' : 'Nome, AK' ,
144 '02185' : 'North Slope, AK' ,
145 '02188' : 'Northwest Arctic, AK' ,
146 '02201' : 'Prince of Wales-Outer Ketchikan, AK' ,
147 '02220' : 'Sitka, AK' ,
148 '02232' : 'Skagway-Hoonah-Angoon, AK' ,
149 '02240' : 'Southeast Fairbanks, AK' ,
150 '02261' : 'Valdez-Cordova, AK' ,
151 '02270' : 'Wade Hampton, AK' ,
152 '02280' : 'Wrangell-Petersburg, AK' ,
153 '02282' : 'Yakutat, AK' ,
154 '02290' : 'Yukon-Koyukuk, AK' ,
155 '01000' : 'ALABAMA' ,
156 '01005' : 'Barbour, AL' ,
157 '01007' : 'Bibb, AL' ,
158 '01011' : 'Bullock, AL' ,
159 '01013' : 'Butler, AL' ,
160 '01017' : 'Chambers, AL' ,
161 '01019' : 'Cherokee, AL' ,
162 '01021' : 'Chilton, AL' ,
163 '01023' : 'Choctaw, AL' ,
164 '01025' : 'Clarke, AL' ,
165 '01027' : 'Clay, AL' ,
166 '01029' : 'Cleburne, AL' ,
167 '01031' : 'Coffee, AL' ,
168 '01035' : 'Conecuh, AL' ,
169 '01037' : 'Coosa, AL' ,
170 '01039' : 'Covington, AL' ,
171 '01041' : 'Crenshaw, AL' ,
172 '01043' : 'Cullman, AL' ,
173 '01047' : 'Dallas, AL' ,
174 '01049' : 'De Kalb, AL' ,
175 '01053' : 'Escambia, AL' ,
176 '01057' : 'Fayette, AL' ,
177 '01059' : 'Franklin, AL' ,
178 '01061' : 'Geneva, AL' ,
179 '01063' : 'Greene, AL' ,
180 '01065' : 'Hale, AL' ,
181 '01067' : 'Henry, AL' ,
182 '01071' : 'Jackson, AL' ,
183 '01075' : 'Lamar, AL' ,
184 '01081' : 'Lee, AL' ,
185 '01085' : 'Lowndes, AL' ,
186 '01087' : 'Macon, AL' ,
187 '01091' : 'Marengo, AL' ,
188 '01093' : 'Marion, AL' ,
189 '01095' : 'Marshall, AL' ,
190 '01099' : 'Monroe, AL' ,
191 '01105' : 'Perry, AL' ,
192 '01107' : 'Pickens, AL' ,
193 '01109' : 'Pike, AL' ,
194 '01111' : 'Randolph, AL' ,
195 '01119' : 'Sumter, AL' ,
196 '01121' : 'Talladega, AL' ,
197 '01123' : 'Tallapoosa, AL' ,
198 '01127' : 'Walker, AL' ,
199 '01129' : 'Washington, AL' ,
200 '01131' : 'Wilcox, AL' ,
201 '01133' : 'Winston, AL' ,
202 '04001' : 'Apache, AZ' ,
203 '04003' : 'Cochise, AZ' ,
204 '04005' : 'Coconino, AZ' ,
205 '04007' : 'Gila, AZ' ,
206 '04009' : 'Graham, AZ' ,
207 '04011' : 'Greenlee, AZ' ,
208 '04012' : 'La Paz, AZ' ,
209 '04017' : 'Navajo, AZ' ,
210 '04023' : 'Santa Cruz, AZ' ,
211 '04025' : 'Yavapai, AZ' ,
212 '05000' : 'ARKANSAS' ,
213 '05001' : 'Arkansas, AR' ,
214 '05003' : 'Ashley, AR' ,
215 '05005' : 'Baxter, AR' ,
216 '05009' : 'Boone, AR' ,
217 '05011' : 'Bradley, AR' ,
218 '05013' : 'Calhoun, AR' ,
219 '05015' : 'Carroll, AR' ,
220 '05017' : 'Chicot, AR' ,
221 '05019' : 'Clark, AR' ,
222 '05021' : 'Clay, AR' ,
223 '05023' : 'Cleburne, AR' ,
224 '05025' : 'Cleveland, AR' ,
225 '05027' : 'Columbia, AR' ,
226 '05029' : 'Conway, AR' ,
227 '05031' : 'Craighead, AR' ,
228 '05037' : 'Cross, AR' ,
229 '05039' : 'Dallas, AR' ,
230 '05041' : 'Desha, AR' ,
231 '05043' : 'Drew, AR' ,
232 '05047' : 'Franklin, AR' ,
233 '05049' : 'Fulton, AR' ,
234 '05051' : 'Garland, AR' ,
235 '05053' : 'Grant, AR' ,
236 '05055' : 'Greene, AR' ,
237 '05057' : 'Hempstead, AR' ,
238 '05059' : 'Hot Spring, AR' ,
239 '05061' : 'Howard, AR' ,
240 '05063' : 'Independence, AR' ,
241 '05065' : 'Izard, AR' ,
242 '05067' : 'Jackson, AR' ,
243 '05071' : 'Johnson, AR' ,
244 '05073' : 'Lafayette, AR' ,
245 '05075' : 'Lawrence, AR' ,
246 '05077' : 'Lee, AR' ,
247 '05079' : 'Lincoln, AR' ,
248 '05081' : 'Little River, AR' ,
249 '05083' : 'Logan, AR' ,
250 '05087' : 'Madison, AR' ,
251 '05089' : 'Marion, AR' ,
252 '05093' : 'Mississippi, AR' ,
253 '05095' : 'Monroe, AR' ,
254 '05097' : 'Montgomery, AR' ,
255 '05099' : 'Nevada, AR' ,
256 '05101' : 'Newton, AR' ,
257 '05103' : 'Ouachita, AR' ,
258 '05105' : 'Perry, AR' ,
259 '05107' : 'Phillips, AR' ,
260 '05109' : 'Pike, AR' ,
261 '05111' : 'Poinsett, AR' ,
262 '05113' : 'Polk, AR' ,
263 '05115' : 'Pope, AR' ,
264 '05117' : 'Prairie, AR' ,
265 '05121' : 'Randolph, AR' ,
266 '05123' : 'St. Francis, AR' ,
267 '05127' : 'Scott, AR' ,
268 '05129' : 'Searcy, AR' ,
269 '05133' : 'Sevier, AR' ,
270 '05135' : 'Sharp, AR' ,
271 '05137' : 'Stone, AR' ,
272 '05139' : 'Union, AR' ,
273 '05141' : 'Van Buren, AR' ,
274 '05145' : 'White, AR' ,
275 '05147' : 'Woodruff, AR' ,
276 '05149' : 'Yell, AR' ,
277 '06000' : 'CALIFORNIA' ,
278 '06003' : 'Alpine, CA' ,
279 '06005' : 'Amador, CA' ,
280 '06009' : 'Calaveras, CA' ,
281 '06011' : 'Colusa, CA' ,
282 '06015' : 'Del Norte, CA' ,
283 '06021' : 'Glenn, CA' ,
284 '06023' : 'Humboldt, CA' ,
285 '06025' : 'Imperial, CA' ,
286 '06027' : 'Inyo, CA' ,
287 '06031' : 'Kings, CA' ,
288 '06033' : 'Lake, CA' ,
289 '06035' : 'Lassen, CA' ,
290 '06043' : 'Mariposa, CA' ,
291 '06045' : 'Mendocino, CA' ,
292 '06049' : 'Modoc, CA' ,
293 '06051' : 'Mono, CA' ,
294 '06057' : 'Nevada, CA' ,
295 '06063' : 'Plumas, CA' ,
296 '06069' : 'San Benito, CA' ,
297 '06091' : 'Sierra, CA' ,
298 '06093' : 'Siskiyou, CA' ,
299 '06103' : 'Tehama, CA' ,
300 '06105' : 'Trinity, CA' ,
301 '06109' : 'Tuolumne, CA' ,
302 '08000' : 'COLORADO' ,
303 '08003' : 'Alamosa, CO' ,
304 '08007' : 'Archuleta, CO' ,
305 '08009' : 'Baca, CO' ,
306 '08011' : 'Bent, CO' ,
307 '08015' : 'Chaffee, CO' ,
308 '08017' : 'Cheyenne, CO' ,
309 '08019' : 'Clear Creek, CO' ,
310 '08021' : 'Conejos, CO' ,
311 '08023' : 'Costilla, CO' ,
312 '08025' : 'Crowley, CO' ,
313 '08027' : 'Custer, CO' ,
314 '08029' : 'Delta, CO' ,
315 '08033' : 'Dolores, CO' ,
316 '08037' : 'Eagle, CO' ,
317 '08039' : 'Elbert, CO' ,
318 '08043' : 'Fremont, CO' ,
319 '08045' : 'Garfield, CO' ,
320 '08047' : 'Gilpin, CO' ,
321 '08049' : 'Grand, CO' ,
322 '08051' : 'Gunnison, CO' ,
323 '08053' : 'Hinsdale, CO' ,
324 '08055' : 'Huerfano, CO' ,
325 '08057' : 'Jackson, CO' ,
326 '08061' : 'Kiowa, CO' ,
327 '08063' : 'Kit Carson, CO' ,
328 '08065' : 'Lake, CO' ,
329 '08067' : 'La Plata, CO' ,
330 '08071' : 'Las Animas, CO' ,
331 '08073' : 'Lincoln, CO' ,
332 '08075' : 'Logan, CO' ,
333 '08077' : 'Mesa, CO' ,
334 '08079' : 'Mineral, CO' ,
335 '08081' : 'Moffat, CO' ,
336 '08083' : 'Montezuma, CO' ,
337 '08085' : 'Montrose, CO' ,
338 '08087' : 'Morgan, CO' ,
339 '08089' : 'Otero, CO' ,
340 '08091' : 'Ouray, CO' ,
341 '08093' : 'Park, CO' ,
342 '08095' : 'Phillips, CO' ,
343 '08097' : 'Pitkin, CO' ,
344 '08099' : 'Prowers, CO' ,
345 '08103' : 'Rio Blanco, CO' ,
346 '08105' : 'Rio Grande, CO' ,
347 '08107' : 'Routt, CO' ,
348 '08109' : 'Saguache, CO' ,
349 '08111' : 'San Juan, CO' ,
350 '08113' : 'San Miguel, CO' ,
351 '08115' : 'Sedgwick, CO' ,
352 '08117' : 'Summit, CO' ,
353 '08119' : 'Teller, CO' ,
354 '08121' : 'Washington, CO' ,
355 '08125' : 'Yuma, CO' ,
356 '09000' : 'CONNECTICUT' ,
357 '09005' : 'Litchfield, CT' ,
358 '09015' : 'Windham, CT' ,
359 '11000' : 'DISTRICT OF COLUMBIA' ,
360 '10000' : 'DELAWARE' ,
361 '10005' : 'Sussex, DE' ,
362 '12000' : 'FLORIDA' ,
363 '12003' : 'Baker, FL' ,
364 '12007' : 'Bradford, FL' ,
365 '12013' : 'Calhoun, FL' ,
366 '12017' : 'Citrus, FL' ,
367 '12023' : 'Columbia, FL' ,
368 '12027' : 'De Soto, FL' ,
369 '12029' : 'Dixie, FL' ,
370 '12037' : 'Franklin, FL' ,
371 '12041' : 'Gilchrist, FL' ,
372 '12043' : 'Glades, FL' ,
373 '12045' : 'Gulf, FL' ,
374 '12047' : 'Hamilton, FL' ,
375 '12049' : 'Hardee, FL' ,
376 '12051' : 'Hendry, FL' ,
377 '12055' : 'Highlands, FL' ,
378 '12059' : 'Holmes, FL' ,
379 '12061' : 'Indian River, FL' ,
380 '12063' : 'Jackson, FL' ,
381 '12065' : 'Jefferson, FL' ,
382 '12067' : 'Lafayette, FL' ,
383 '12075' : 'Levy, FL' ,
384 '12077' : 'Liberty, FL' ,
385 '12079' : 'Madison, FL' ,
386 '12087' : 'Monroe, FL' ,
387 '12093' : 'Okeechobee, FL' ,
388 '12107' : 'Putnam, FL' ,
389 '12119' : 'Sumter, FL' ,
390 '12121' : 'Suwannee, FL' ,
391 '12123' : 'Taylor, FL' ,
392 '12125' : 'Union, FL' ,
393 '12129' : 'Wakulla, FL' ,
394 '12131' : 'Walton, FL' ,
395 '12133' : 'Washington, FL' ,
396 '13000' : 'GEORGIA' ,
397 '13001' : 'Appling, GA' ,
398 '13003' : 'Atkinson, GA' ,
399 '13005' : 'Bacon, GA' ,
400 '13007' : 'Baker, GA' ,
401 '13009' : 'Baldwin, GA' ,
402 '13011' : 'Banks, GA' ,
403 '13017' : 'Ben Hill, GA' ,
404 '13019' : 'Berrien, GA' ,
405 '13023' : 'Bleckley, GA' ,
406 '13025' : 'Brantley, GA' ,
407 '13027' : 'Brooks, GA' ,
408 '13031' : 'Bulloch, GA' ,
409 '13033' : 'Burke, GA' ,
410 '13035' : 'Butts, GA' ,
411 '13037' : 'Calhoun, GA' ,
412 '13039' : 'Camden, GA' ,
413 '13043' : 'Candler, GA' ,
414 '13049' : 'Charlton, GA' ,
415 '13055' : 'Chattooga, GA' ,
416 '13061' : 'Clay, GA' ,
417 '13065' : 'Clinch, GA' ,
418 '13069' : 'Coffee, GA' ,
419 '13071' : 'Colquitt, GA' ,
420 '13075' : 'Cook, GA' ,
421 '13079' : 'Crawford, GA' ,
422 '13081' : 'Crisp, GA' ,
423 '13085' : 'Dawson, GA' ,
424 '13087' : 'Decatur, GA' ,
425 '13091' : 'Dodge, GA' ,
426 '13093' : 'Dooly, GA' ,
427 '13099' : 'Early, GA' ,
428 '13101' : 'Echols, GA' ,
429 '13105' : 'Elbert, GA' ,
430 '13107' : 'Emanuel, GA' ,
431 '13109' : 'Evans, GA' ,
432 '13111' : 'Fannin, GA' ,
433 '13115' : 'Floyd, GA' ,
434 '13119' : 'Franklin, GA' ,
435 '13123' : 'Gilmer, GA' ,
436 '13125' : 'Glascock, GA' ,
437 '13127' : 'Glynn, GA' ,
438 '13129' : 'Gordon, GA' ,
439 '13131' : 'Grady, GA' ,
440 '13133' : 'Greene, GA' ,
441 '13137' : 'Habersham, GA' ,
442 '13139' : 'Hall, GA' ,
443 '13141' : 'Hancock, GA' ,
444 '13143' : 'Haralson, GA' ,
445 '13147' : 'Hart, GA' ,
446 '13149' : 'Heard, GA' ,
447 '13155' : 'Irwin, GA' ,
448 '13157' : 'Jackson, GA' ,
449 '13159' : 'Jasper, GA' ,
450 '13161' : 'Jeff Davis, GA' ,
451 '13163' : 'Jefferson, GA' ,
452 '13165' : 'Jenkins, GA' ,
453 '13167' : 'Johnson, GA' ,
454 '13171' : 'Lamar, GA' ,
455 '13173' : 'Lanier, GA' ,
456 '13175' : 'Laurens, GA' ,
457 '13179' : 'Liberty, GA' ,
458 '13181' : 'Lincoln, GA' ,
459 '13183' : 'Long, GA' ,
460 '13185' : 'Lowndes, GA' ,
461 '13187' : 'Lumpkin, GA' ,
462 '13189' : 'McDuffie, GA' ,
463 '13191' : 'McIntosh, GA' ,
464 '13193' : 'Macon, GA' ,
465 '13197' : 'Marion, GA' ,
466 '13199' : 'Meriwether, GA' ,
467 '13201' : 'Miller, GA' ,
468 '13205' : 'Mitchell, GA' ,
469 '13207' : 'Monroe, GA' ,
470 '13209' : 'Montgomery, GA' ,
471 '13211' : 'Morgan, GA' ,
472 '13213' : 'Murray, GA' ,
473 '13221' : 'Oglethorpe, GA' ,
474 '13229' : 'Pierce, GA' ,
475 '13231' : 'Pike, GA' ,
476 '13233' : 'Polk, GA' ,
477 '13235' : 'Pulaski, GA' ,
478 '13237' : 'Putnam, GA' ,
479 '13239' : 'Quitman, GA' ,
480 '13241' : 'Rabun, GA' ,
481 '13243' : 'Randolph, GA' ,
482 '13249' : 'Schley, GA' ,
483 '13251' : 'Screven, GA' ,
484 '13253' : 'Seminole, GA' ,
485 '13257' : 'Stephens, GA' ,
486 '13259' : 'Stewart, GA' ,
487 '13261' : 'Sumter, GA' ,
488 '13263' : 'Talbot, GA' ,
489 '13265' : 'Taliaferro, GA' ,
490 '13267' : 'Tattnall, GA' ,
491 '13269' : 'Taylor, GA' ,
492 '13271' : 'Telfair, GA' ,
493 '13273' : 'Terrell, GA' ,
494 '13275' : 'Thomas, GA' ,
495 '13277' : 'Tift, GA' ,
496 '13279' : 'Toombs, GA' ,
497 '13281' : 'Towns, GA' ,
498 '13283' : 'Treutlen, GA' ,
499 '13285' : 'Troup, GA' ,
500 '13287' : 'Turner, GA' ,
501 '13291' : 'Union, GA' ,
502 '13293' : 'Upson, GA' ,
503 '13299' : 'Ware, GA' ,
504 '13301' : 'Warren, GA' ,
505 '13303' : 'Washington, GA' ,
506 '13305' : 'Wayne, GA' ,
507 '13307' : 'Webster, GA' ,
508 '13309' : 'Wheeler, GA' ,
509 '13311' : 'White, GA' ,
510 '13313' : 'Whitfield, GA' ,
511 '13315' : 'Wilcox, GA' ,
512 '13317' : 'Wilkes, GA' ,
513 '13319' : 'Wilkinson, GA' ,
514 '13321' : 'Worth, GA' ,
515 '15000' : 'HAWAII' ,
516 '15001' : 'Hawaii, HI' ,
517 '15005' : 'Kalawao, HI' ,
518 '15007' : 'Kauai, HI' ,
519 '15009' : 'Maui, HI' ,
520 '19000' : 'IOWA' ,
521 '19001' : 'Adair, IA' ,
522 '19003' : 'Adams, IA' ,
523 '19005' : 'Allamakee, IA' ,
524 '19007' : 'Appanoose, IA' ,
525 '19009' : 'Audubon, IA' ,
526 '19011' : 'Benton, IA' ,
527 '19015' : 'Boone, IA' ,
528 '19017' : 'Bremer, IA' ,
529 '19019' : 'Buchanan, IA' ,
530 '19021' : 'Buena Vista, IA' ,
531 '19023' : 'Butler, IA' ,
532 '19025' : 'Calhoun, IA' ,
533 '19027' : 'Carroll, IA' ,
534 '19029' : 'Cass, IA' ,
535 '19031' : 'Cedar, IA' ,
536 '19033' : 'Cerro Gordo, IA' ,
537 '19035' : 'Cherokee, IA' ,
538 '19037' : 'Chickasaw, IA' ,
539 '19039' : 'Clarke, IA' ,
540 '19041' : 'Clay, IA' ,
541 '19043' : 'Clayton, IA' ,
542 '19045' : 'Clinton, IA' ,
543 '19047' : 'Crawford, IA' ,
544 '19051' : 'Davis, IA' ,
545 '19053' : 'Decatur, IA' ,
546 '19055' : 'Delaware, IA' ,
547 '19057' : 'Des Moines, IA' ,
548 '19059' : 'Dickinson, IA' ,
549 '19063' : 'Emmet, IA' ,
550 '19065' : 'Fayette, IA' ,
551 '19067' : 'Floyd, IA' ,
552 '19069' : 'Franklin, IA' ,
553 '19071' : 'Fremont, IA' ,
554 '19073' : 'Greene, IA' ,
555 '19075' : 'Grundy, IA' ,
556 '19077' : 'Guthrie, IA' ,
557 '19079' : 'Hamilton, IA' ,
558 '19081' : 'Hancock, IA' ,
559 '19083' : 'Hardin, IA' ,
560 '19085' : 'Harrison, IA' ,
561 '19087' : 'Henry, IA' ,
562 '19089' : 'Howard, IA' ,
563 '19091' : 'Humboldt, IA' ,
564 '19093' : 'Ida, IA' ,
565 '19095' : 'Iowa, IA' ,
566 '19097' : 'Jackson, IA' ,
567 '19099' : 'Jasper, IA' ,
568 '19101' : 'Jefferson, IA' ,
569 '19105' : 'Jones, IA' ,
570 '19107' : 'Keokuk, IA' ,
571 '19109' : 'Kossuth, IA' ,
572 '19111' : 'Lee, IA' ,
573 '19115' : 'Louisa, IA' ,
574 '19117' : 'Lucas, IA' ,
575 '19119' : 'Lyon, IA' ,
576 '19121' : 'Madison, IA' ,
577 '19123' : 'Mahaska, IA' ,
578 '19125' : 'Marion, IA' ,
579 '19127' : 'Marshall, IA' ,
580 '19129' : 'Mills, IA' ,
581 '19131' : 'Mitchell, IA' ,
582 '19133' : 'Monona, IA' ,
583 '19135' : 'Monroe, IA' ,
584 '19137' : 'Montgomery, IA' ,
585 '19139' : 'Muscatine, IA' ,
586 '19141' : 'O\'Brien, IA' ,
587 '19143' : 'Osceola, IA' ,
588 '19145' : 'Page, IA' ,
589 '19147' : 'Palo Alto, IA' ,
590 '19149' : 'Plymouth, IA' ,
591 '19151' : 'Pocahontas, IA' ,
592 '19157' : 'Poweshiek, IA' ,
593 '19159' : 'Ringgold, IA' ,
594 '19161' : 'Sac, IA' ,
595 '19165' : 'Shelby, IA' ,
596 '19167' : 'Sioux, IA' ,
597 '19169' : 'Story, IA' ,
598 '19171' : 'Tama, IA' ,
599 '19173' : 'Taylor, IA' ,
600 '19175' : 'Union, IA' ,
601 '19177' : 'Van Buren, IA' ,
602 '19179' : 'Wapello, IA' ,
603 '19183' : 'Washington, IA' ,
604 '19185' : 'Wayne, IA' ,
605 '19187' : 'Webster, IA' ,
606 '19189' : 'Winnebago, IA' ,
607 '19191' : 'Winneshiek, IA' ,
608 '19195' : 'Worth, IA' ,
609 '19197' : 'Wright, IA' ,
610 '16000' : 'IDAHO' ,
611 '16003' : 'Adams, ID' ,
612 '16005' : 'Bannock, ID' ,
613 '16007' : 'Bear Lake, ID' ,
614 '16009' : 'Benewah, ID' ,
615 '16011' : 'Bingham, ID' ,
616 '16013' : 'Blaine, ID' ,
617 '16015' : 'Boise, ID' ,
618 '16017' : 'Bonner, ID' ,
619 '16019' : 'Bonneville, ID' ,
620 '16021' : 'Boundary, ID' ,
621 '16023' : 'Butte, ID' ,
622 '16025' : 'Camas, ID' ,
623 '16029' : 'Caribou, ID' ,
624 '16031' : 'Cassia, ID' ,
625 '16033' : 'Clark, ID' ,
626 '16035' : 'Clearwater, ID' ,
627 '16037' : 'Custer, ID' ,
628 '16039' : 'Elmore, ID' ,
629 '16041' : 'Franklin, ID' ,
630 '16043' : 'Fremont, ID' ,
631 '16045' : 'Gem, ID' ,
632 '16047' : 'Gooding, ID' ,
633 '16049' : 'Idaho, ID' ,
634 '16051' : 'Jefferson, ID' ,
635 '16053' : 'Jerome, ID' ,
636 '16055' : 'Kootenai, ID' ,
637 '16057' : 'Latah, ID' ,
638 '16059' : 'Lemhi, ID' ,
639 '16061' : 'Lewis, ID' ,
640 '16063' : 'Lincoln, ID' ,
641 '16065' : 'Madison, ID' ,
642 '16067' : 'Minidoka, ID' ,
643 '16069' : 'Nez Perce, ID' ,
644 '16071' : 'Oneida, ID' ,
645 '16073' : 'Owyhee, ID' ,
646 '16075' : 'Payette, ID' ,
647 '16077' : 'Power, ID' ,
648 '16079' : 'Shoshone, ID' ,
649 '16081' : 'Teton, ID' ,
650 '16083' : 'Twin Falls, ID' ,
651 '16085' : 'Valley, ID' ,
652 '16087' : 'Washington, ID' ,
653 '17000' : 'ILLINOIS' ,
654 '17001' : 'Adams, IL' ,
655 '17003' : 'Alexander, IL' ,
656 '17005' : 'Bond, IL' ,
657 '17009' : 'Brown, IL' ,
658 '17011' : 'Bureau, IL' ,
659 '17013' : 'Calhoun, IL' ,
660 '17015' : 'Carroll, IL' ,
661 '17017' : 'Cass, IL' ,
662 '17021' : 'Christian, IL' ,
663 '17023' : 'Clark, IL' ,
664 '17025' : 'Clay, IL' ,
665 '17029' : 'Coles, IL' ,
666 '17033' : 'Crawford, IL' ,
667 '17035' : 'Cumberland, IL' ,
668 '17039' : 'De Witt, IL' ,
669 '17041' : 'Douglas, IL' ,
670 '17045' : 'Edgar, IL' ,
671 '17047' : 'Edwards, IL' ,
672 '17049' : 'Effingham, IL' ,
673 '17051' : 'Fayette, IL' ,
674 '17053' : 'Ford, IL' ,
675 '17055' : 'Franklin, IL' ,
676 '17057' : 'Fulton, IL' ,
677 '17059' : 'Gallatin, IL' ,
678 '17061' : 'Greene, IL' ,
679 '17065' : 'Hamilton, IL' ,
680 '17067' : 'Hancock, IL' ,
681 '17069' : 'Hardin, IL' ,
682 '17071' : 'Henderson, IL' ,
683 '17075' : 'Iroquois, IL' ,
684 '17077' : 'Jackson, IL' ,
685 '17079' : 'Jasper, IL' ,
686 '17081' : 'Jefferson, IL' ,
687 '17085' : 'Jo Daviess, IL' ,
688 '17087' : 'Johnson, IL' ,
689 '17095' : 'Knox, IL' ,
690 '17099' : 'La Salle, IL' ,
691 '17101' : 'Lawrence, IL' ,
692 '17103' : 'Lee, IL' ,
693 '17105' : 'Livingston, IL' ,
694 '17107' : 'Logan, IL' ,
695 '17109' : 'McDonough, IL' ,
696 '17117' : 'Macoupin, IL' ,
697 '17121' : 'Marion, IL' ,
698 '17123' : 'Marshall, IL' ,
699 '17125' : 'Mason, IL' ,
700 '17127' : 'Massac, IL' ,
701 '17131' : 'Mercer, IL' ,
702 '17135' : 'Montgomery, IL' ,
703 '17137' : 'Morgan, IL' ,
704 '17139' : 'Moultrie, IL' ,
705 '17145' : 'Perry, IL' ,
706 '17147' : 'Piatt, IL' ,
707 '17149' : 'Pike, IL' ,
708 '17151' : 'Pope, IL' ,
709 '17153' : 'Pulaski, IL' ,
710 '17155' : 'Putnam, IL' ,
711 '17157' : 'Randolph, IL' ,
712 '17159' : 'Richland, IL' ,
713 '17165' : 'Saline, IL' ,
714 '17169' : 'Schuyler, IL' ,
715 '17171' : 'Scott, IL' ,
716 '17173' : 'Shelby, IL' ,
717 '17175' : 'Stark, IL' ,
718 '17177' : 'Stephenson, IL' ,
719 '17181' : 'Union, IL' ,
720 '17183' : 'Vermilion, IL' ,
721 '17185' : 'Wabash, IL' ,
722 '17187' : 'Warren, IL' ,
723 '17189' : 'Washington, IL' ,
724 '17191' : 'Wayne, IL' ,
725 '17193' : 'White, IL' ,
726 '17195' : 'Whiteside, IL' ,
727 '17199' : 'Williamson, IL' ,
728 '18000' : 'INDIANA' ,
729 '18005' : 'Bartholomew, IN' ,
730 '18007' : 'Benton, IN' ,
731 '18009' : 'Blackford, IN' ,
732 '18013' : 'Brown, IN' ,
733 '18015' : 'Carroll, IN' ,
734 '18017' : 'Cass, IN' ,
735 '18025' : 'Crawford, IN' ,
736 '18027' : 'Daviess, IN' ,
737 '18031' : 'Decatur, IN' ,
738 '18037' : 'Dubois, IN' ,
739 '18041' : 'Fayette, IN' ,
740 '18045' : 'Fountain, IN' ,
741 '18047' : 'Franklin, IN' ,
742 '18049' : 'Fulton, IN' ,
743 '18051' : 'Gibson, IN' ,
744 '18053' : 'Grant, IN' ,
745 '18055' : 'Greene, IN' ,
746 '18065' : 'Henry, IN' ,
747 '18071' : 'Jackson, IN' ,
748 '18073' : 'Jasper, IN' ,
749 '18075' : 'Jay, IN' ,
750 '18077' : 'Jefferson, IN' ,
751 '18079' : 'Jennings, IN' ,
752 '18083' : 'Knox, IN' ,
753 '18085' : 'Kosciusko, IN' ,
754 '18087' : 'Lagrange, IN' ,
755 '18091' : 'La Porte, IN' ,
756 '18093' : 'Lawrence, IN' ,
757 '18099' : 'Marshall, IN' ,
758 '18101' : 'Martin, IN' ,
759 '18103' : 'Miami, IN' ,
760 '18107' : 'Montgomery, IN' ,
761 '18111' : 'Newton, IN' ,
762 '18113' : 'Noble, IN' ,
763 '18117' : 'Orange, IN' ,
764 '18119' : 'Owen, IN' ,
765 '18121' : 'Parke, IN' ,
766 '18123' : 'Perry, IN' ,
767 '18125' : 'Pike, IN' ,
768 '18131' : 'Pulaski, IN' ,
769 '18133' : 'Putnam, IN' ,
770 '18135' : 'Randolph, IN' ,
771 '18137' : 'Ripley, IN' ,
772 '18139' : 'Rush, IN' ,
773 '18147' : 'Spencer, IN' ,
774 '18149' : 'Starke, IN' ,
775 '18151' : 'Steuben, IN' ,
776 '18153' : 'Sullivan, IN' ,
777 '18155' : 'Switzerland, IN' ,
778 '18161' : 'Union, IN' ,
779 '18169' : 'Wabash, IN' ,
780 '18171' : 'Warren, IN' ,
781 '18175' : 'Washington, IN' ,
782 '18177' : 'Wayne, IN' ,
783 '18181' : 'White, IN' ,
784 '20000' : 'KANSAS' ,
785 '20001' : 'Allen, KS' ,
786 '20003' : 'Anderson, KS' ,
787 '20005' : 'Atchison, KS' ,
788 '20007' : 'Barber, KS' ,
789 '20009' : 'Barton, KS' ,
790 '20011' : 'Bourbon, KS' ,
791 '20013' : 'Brown, KS' ,
792 '20017' : 'Chase, KS' ,
793 '20019' : 'Chautauqua, KS' ,
794 '20021' : 'Cherokee, KS' ,
795 '20023' : 'Cheyenne, KS' ,
796 '20025' : 'Clark, KS' ,
797 '20027' : 'Clay, KS' ,
798 '20029' : 'Cloud, KS' ,
799 '20031' : 'Coffey, KS' ,
800 '20033' : 'Comanche, KS' ,
801 '20035' : 'Cowley, KS' ,
802 '20037' : 'Crawford, KS' ,
803 '20039' : 'Decatur, KS' ,
804 '20041' : 'Dickinson, KS' ,
805 '20043' : 'Doniphan, KS' ,
806 '20047' : 'Edwards, KS' ,
807 '20049' : 'Elk, KS' ,
808 '20051' : 'Ellis, KS' ,
809 '20053' : 'Ellsworth, KS' ,
810 '20055' : 'Finney, KS' ,
811 '20057' : 'Ford, KS' ,
812 '20059' : 'Franklin, KS' ,
813 '20061' : 'Geary, KS' ,
814 '20063' : 'Gove, KS' ,
815 '20065' : 'Graham, KS' ,
816 '20067' : 'Grant, KS' ,
817 '20069' : 'Gray, KS' ,
818 '20071' : 'Greeley, KS' ,
819 '20073' : 'Greenwood, KS' ,
820 '20075' : 'Hamilton, KS' ,
821 '20077' : 'Harper, KS' ,
822 '20081' : 'Haskell, KS' ,
823 '20083' : 'Hodgeman, KS' ,
824 '20085' : 'Jackson, KS' ,
825 '20087' : 'Jefferson, KS' ,
826 '20089' : 'Jewell, KS' ,
827 '20093' : 'Kearny, KS' ,
828 '20095' : 'Kingman, KS' ,
829 '20097' : 'Kiowa, KS' ,
830 '20099' : 'Labette, KS' ,
831 '20101' : 'Lane, KS' ,
832 '20105' : 'Lincoln, KS' ,
833 '20107' : 'Linn, KS' ,
834 '20109' : 'Logan, KS' ,
835 '20111' : 'Lyon, KS' ,
836 '20113' : 'McPherson, KS' ,
837 '20115' : 'Marion, KS' ,
838 '20117' : 'Marshall, KS' ,
839 '20119' : 'Meade, KS' ,
840 '20123' : 'Mitchell, KS' ,
841 '20125' : 'Montgomery, KS' ,
842 '20127' : 'Morris, KS' ,
843 '20129' : 'Morton, KS' ,
844 '20131' : 'Nemaha, KS' ,
845 '20133' : 'Neosho, KS' ,
846 '20135' : 'Ness, KS' ,
847 '20137' : 'Norton, KS' ,
848 '20139' : 'Osage, KS' ,
849 '20141' : 'Osborne, KS' ,
850 '20143' : 'Ottawa, KS' ,
851 '20145' : 'Pawnee, KS' ,
852 '20147' : 'Phillips, KS' ,
853 '20149' : 'Pottawatomie, KS' ,
854 '20151' : 'Pratt, KS' ,
855 '20153' : 'Rawlins, KS' ,
856 '20155' : 'Reno, KS' ,
857 '20157' : 'Republic, KS' ,
858 '20159' : 'Rice, KS' ,
859 '20161' : 'Riley, KS' ,
860 '20163' : 'Rooks, KS' ,
861 '20165' : 'Rush, KS' ,
862 '20167' : 'Russell, KS' ,
863 '20169' : 'Saline, KS' ,
864 '20171' : 'Scott, KS' ,
865 '20175' : 'Seward, KS' ,
866 '20179' : 'Sheridan, KS' ,
867 '20181' : 'Sherman, KS' ,
868 '20183' : 'Smith, KS' ,
869 '20185' : 'Stafford, KS' ,
870 '20187' : 'Stanton, KS' ,
871 '20189' : 'Stevens, KS' ,
872 '20191' : 'Sumner, KS' ,
873 '20193' : 'Thomas, KS' ,
874 '20195' : 'Trego, KS' ,
875 '20197' : 'Wabaunsee, KS' ,
876 '20199' : 'Wallace, KS' ,
877 '20201' : 'Washington, KS' ,
878 '20203' : 'Wichita, KS' ,
879 '20205' : 'Wilson, KS' ,
880 '20207' : 'Woodson, KS' ,
881 '21000' : 'KENTUCKY' ,
882 '21001' : 'Adair, KY' ,
883 '21003' : 'Allen, KY' ,
884 '21005' : 'Anderson, KY' ,
885 '21007' : 'Ballard, KY' ,
886 '21009' : 'Barren, KY' ,
887 '21011' : 'Bath, KY' ,
888 '21013' : 'Bell, KY' ,
889 '21021' : 'Boyle, KY' ,
890 '21023' : 'Bracken, KY' ,
891 '21025' : 'Breathitt, KY' ,
892 '21027' : 'Breckinridge, KY' ,
893 '21031' : 'Butler, KY' ,
894 '21033' : 'Caldwell, KY' ,
895 '21035' : 'Calloway, KY' ,
896 '21039' : 'Carlisle, KY' ,
897 '21041' : 'Carroll, KY' ,
898 '21043' : 'Carter, KY' ,
899 '21045' : 'Casey, KY' ,
900 '21051' : 'Clay, KY' ,
901 '21053' : 'Clinton, KY' ,
902 '21055' : 'Crittenden, KY' ,
903 '21057' : 'Cumberland, KY' ,
904 '21061' : 'Edmonson, KY' ,
905 '21063' : 'Elliott, KY' ,
906 '21065' : 'Estill, KY' ,
907 '21069' : 'Fleming, KY' ,
908 '21071' : 'Floyd, KY' ,
909 '21073' : 'Franklin, KY' ,
910 '21075' : 'Fulton, KY' ,
911 '21079' : 'Garrard, KY' ,
912 '21083' : 'Graves, KY' ,
913 '21085' : 'Grayson, KY' ,
914 '21087' : 'Green, KY' ,
915 '21091' : 'Hancock, KY' ,
916 '21093' : 'Hardin, KY' ,
917 '21095' : 'Harlan, KY' ,
918 '21097' : 'Harrison, KY' ,
919 '21099' : 'Hart, KY' ,
920 '21103' : 'Henry, KY' ,
921 '21105' : 'Hickman, KY' ,
922 '21107' : 'Hopkins, KY' ,
923 '21109' : 'Jackson, KY' ,
924 '21115' : 'Johnson, KY' ,
925 '21119' : 'Knott, KY' ,
926 '21121' : 'Knox, KY' ,
927 '21123' : 'Larue, KY' ,
928 '21125' : 'Laurel, KY' ,
929 '21127' : 'Lawrence, KY' ,
930 '21129' : 'Lee, KY' ,
931 '21131' : 'Leslie, KY' ,
932 '21133' : 'Letcher, KY' ,
933 '21135' : 'Lewis, KY' ,
934 '21137' : 'Lincoln, KY' ,
935 '21139' : 'Livingston, KY' ,
936 '21141' : 'Logan, KY' ,
937 '21143' : 'Lyon, KY' ,
938 '21145' : 'McCracken, KY' ,
939 '21147' : 'McCreary, KY' ,
940 '21149' : 'McLean, KY' ,
941 '21153' : 'Magoffin, KY' ,
942 '21155' : 'Marion, KY' ,
943 '21157' : 'Marshall, KY' ,
944 '21159' : 'Martin, KY' ,
945 '21161' : 'Mason, KY' ,
946 '21163' : 'Meade, KY' ,
947 '21165' : 'Menifee, KY' ,
948 '21167' : 'Mercer, KY' ,
949 '21169' : 'Metcalfe, KY' ,
950 '21171' : 'Monroe, KY' ,
951 '21173' : 'Montgomery, KY' ,
952 '21175' : 'Morgan, KY' ,
953 '21177' : 'Muhlenberg, KY' ,
954 '21179' : 'Nelson, KY' ,
955 '21181' : 'Nicholas, KY' ,
956 '21183' : 'Ohio, KY' ,
957 '21187' : 'Owen, KY' ,
958 '21189' : 'Owsley, KY' ,
959 '21193' : 'Perry, KY' ,
960 '21195' : 'Pike, KY' ,
961 '21197' : 'Powell, KY' ,
962 '21199' : 'Pulaski, KY' ,
963 '21201' : 'Robertson, KY' ,
964 '21203' : 'Rockcastle, KY' ,
965 '21205' : 'Rowan, KY' ,
966 '21207' : 'Russell, KY' ,
967 '21211' : 'Shelby, KY' ,
968 '21213' : 'Simpson, KY' ,
969 '21215' : 'Spencer, KY' ,
970 '21217' : 'Taylor, KY' ,
971 '21219' : 'Todd, KY' ,
972 '21221' : 'Trigg, KY' ,
973 '21223' : 'Trimble, KY' ,
974 '21225' : 'Union, KY' ,
975 '21227' : 'Warren, KY' ,
976 '21229' : 'Washington, KY' ,
977 '21231' : 'Wayne, KY' ,
978 '21233' : 'Webster, KY' ,
979 '21235' : 'Whitley, KY' ,
980 '21237' : 'Wolfe, KY' ,
981 '22000' : 'LOUISIANA' ,
982 '22003' : 'Allen, LA' ,
983 '22005' : 'Ascension, LA' ,
984 '22007' : 'Assumption, LA' ,
985 '22009' : 'Avoyelles, LA' ,
986 '22011' : 'Beauregard, LA' ,
987 '22013' : 'Bienville, LA' ,
988 '22021' : 'Caldwell, LA' ,
989 '22023' : 'Cameron, LA' ,
990 '22025' : 'Catahoula, LA' ,
991 '22027' : 'Claiborne, LA' ,
992 '22029' : 'Concordia, LA' ,
993 '22031' : 'De Soto, LA' ,
994 '22035' : 'East Carroll, LA' ,
995 '22037' : 'East Feliciana, LA' ,
996 '22039' : 'Evangeline, LA' ,
997 '22041' : 'Franklin, LA' ,
998 '22043' : 'Grant, LA' ,
999 '22045' : 'Iberia, LA' ,
1000 '22047' : 'Iberville, LA' ,
1001 '22049' : 'Jackson, LA' ,
1002 '22053' : 'Jefferson Davis, LA' ,
1003 '22059' : 'La Salle, LA' ,
1004 '22061' : 'Lincoln, LA' ,
1005 '22065' : 'Madison, LA' ,
1006 '22067' : 'Morehouse, LA' ,
1007 '22069' : 'Natchitoches, LA' ,
1008 '22077' : 'Pointe Coupee, LA' ,
1009 '22081' : 'Red River, LA' ,
1010 '22083' : 'Richland, LA' ,
1011 '22085' : 'Sabine, LA' ,
1012 '22091' : 'St. Helena, LA' ,
1013 '22101' : 'St. Mary, LA' ,
1014 '22105' : 'Tangipahoa, LA' ,
1015 '22107' : 'Tensas, LA' ,
1016 '22111' : 'Union, LA' ,
1017 '22113' : 'Vermilion, LA' ,
1018 '22115' : 'Vernon, LA' ,
1019 '22117' : 'Washington, LA' ,
1020 '22123' : 'West Carroll, LA' ,
1021 '22125' : 'West Feliciana, LA' ,
1022 '22127' : 'Winn, LA' ,
1023 '25000' : 'MASSACHUSETTS' ,
1024 '25007' : 'Dukes, MA' ,
1025 '25011' : 'Franklin, MA' ,
1026 '25019' : 'Nantucket, MA' ,
1027 '24000' : 'MARYLAND' ,
1028 '24011' : 'Caroline, MD' ,
1029 '24019' : 'Dorchester, MD' ,
1030 '24023' : 'Garrett, MD' ,
1031 '24029' : 'Kent, MD' ,
1032 '24037' : 'St. Mary\'s, MD' ,
1033 '24039' : 'Somerset, MD' ,
1034 '24041' : 'Talbot, MD' ,
1035 '24045' : 'Wicomico, MD' ,
1036 '24047' : 'Worcester, MD' ,
1037 '23000' : 'MAINE' ,
1038 '23003' : 'Aroostook, ME' ,
1039 '23007' : 'Franklin, ME' ,
1040 '23009' : 'Hancock, ME' ,
1041 '23011' : 'Kennebec, ME' ,
1042 '23013' : 'Knox, ME' ,
1043 '23015' : 'Lincoln, ME' ,
1044 '23017' : 'Oxford, ME' ,
1045 '23021' : 'Piscataquis, ME' ,
1046 '23023' : 'Sagadahoc, ME' ,
1047 '23025' : 'Somerset, ME' ,
1048 '23027' : 'Waldo, ME' ,
1049 '23029' : 'Washington, ME' ,
1050 '23031' : 'York, ME' ,
1051 '26000' : 'MICHIGAN' ,
1052 '26001' : 'Alcona, MI' ,
1053 '26003' : 'Alger, MI' ,
1054 '26007' : 'Alpena, MI' ,
1055 '26009' : 'Antrim, MI' ,
1056 '26011' : 'Arenac, MI' ,
1057 '26013' : 'Baraga, MI' ,
1058 '26015' : 'Barry, MI' ,
1059 '26019' : 'Benzie, MI' ,
1060 '26023' : 'Branch, MI' ,
1061 '26027' : 'Cass, MI' ,
1062 '26029' : 'Charlevoix, MI' ,
1063 '26031' : 'Cheboygan, MI' ,
1064 '26033' : 'Chippewa, MI' ,
1065 '26035' : 'Clare, MI' ,
1066 '26039' : 'Crawford, MI' ,
1067 '26041' : 'Delta, MI' ,
1068 '26043' : 'Dickinson, MI' ,
1069 '26047' : 'Emmet, MI' ,
1070 '26051' : 'Gladwin, MI' ,
1071 '26053' : 'Gogebic, MI' ,
1072 '26055' : 'Grand Traverse, MI' ,
1073 '26057' : 'Gratiot, MI' ,
1074 '26059' : 'Hillsdale, MI' ,
1075 '26061' : 'Houghton, MI' ,
1076 '26063' : 'Huron, MI' ,
1077 '26067' : 'Ionia, MI' ,
1078 '26069' : 'Iosco, MI' ,
1079 '26071' : 'Iron, MI' ,
1080 '26073' : 'Isabella, MI' ,
1081 '26079' : 'Kalkaska, MI' ,
1082 '26083' : 'Keweenaw, MI' ,
1083 '26085' : 'Lake, MI' ,
1084 '26089' : 'Leelanau, MI' ,
1085 '26095' : 'Luce, MI' ,
1086 '26097' : 'Mackinac, MI' ,
1087 '26101' : 'Manistee, MI' ,
1088 '26103' : 'Marquette, MI' ,
1089 '26105' : 'Mason, MI' ,
1090 '26107' : 'Mecosta, MI' ,
1091 '26109' : 'Menominee, MI' ,
1092 '26113' : 'Missaukee, MI' ,
1093 '26117' : 'Montcalm, MI' ,
1094 '26119' : 'Montmorency, MI' ,
1095 '26123' : 'Newaygo, MI' ,
1096 '26127' : 'Oceana, MI' ,
1097 '26129' : 'Ogemaw, MI' ,
1098 '26131' : 'Ontonagon, MI' ,
1099 '26133' : 'Osceola, MI' ,
1100 '26135' : 'Oscoda, MI' ,
1101 '26137' : 'Otsego, MI' ,
1102 '26141' : 'Presque Isle, MI' ,
1103 '26143' : 'Roscommon, MI' ,
1104 '26149' : 'St. Joseph, MI' ,
1105 '26151' : 'Sanilac, MI' ,
1106 '26153' : 'Schoolcraft, MI' ,
1107 '26155' : 'Shiawassee, MI' ,
1108 '26157' : 'Tuscola, MI' ,
1109 '26165' : 'Wexford, MI' ,
1110 '27000' : 'MINNESOTA' ,
1111 '27001' : 'Aitkin, MN' ,
1112 '27005' : 'Becker, MN' ,
1113 '27007' : 'Beltrami, MN' ,
1114 '27011' : 'Big Stone, MN' ,
1115 '27013' : 'Blue Earth, MN' ,
1116 '27015' : 'Brown, MN' ,
1117 '27017' : 'Carlton, MN' ,
1118 '27021' : 'Cass, MN' ,
1119 '27023' : 'Chippewa, MN' ,
1120 '27029' : 'Clearwater, MN' ,
1121 '27031' : 'Cook, MN' ,
1122 '27033' : 'Cottonwood, MN' ,
1123 '27035' : 'Crow Wing, MN' ,
1124 '27039' : 'Dodge, MN' ,
1125 '27041' : 'Douglas, MN' ,
1126 '27043' : 'Faribault, MN' ,
1127 '27045' : 'Fillmore, MN' ,
1128 '27047' : 'Freeborn, MN' ,
1129 '27049' : 'Goodhue, MN' ,
1130 '27051' : 'Grant, MN' ,
1131 '27057' : 'Hubbard, MN' ,
1132 '27061' : 'Itasca, MN' ,
1133 '27063' : 'Jackson, MN' ,
1134 '27065' : 'Kanabec, MN' ,
1135 '27067' : 'Kandiyohi, MN' ,
1136 '27069' : 'Kittson, MN' ,
1137 '27071' : 'Koochiching, MN' ,
1138 '27073' : 'Lac qui Parle, MN' ,
1139 '27075' : 'Lake, MN' ,
1140 '27077' : 'Lake of the Woods, MN' ,
1141 '27079' : 'Le Sueur, MN' ,
1142 '27081' : 'Lincoln, MN' ,
1143 '27083' : 'Lyon, MN' ,
1144 '27085' : 'McLeod, MN' ,
1145 '27087' : 'Mahnomen, MN' ,
1146 '27089' : 'Marshall, MN' ,
1147 '27091' : 'Martin, MN' ,
1148 '27093' : 'Meeker, MN' ,
1149 '27095' : 'Mille Lacs, MN' ,
1150 '27097' : 'Morrison, MN' ,
1151 '27099' : 'Mower, MN' ,
1152 '27101' : 'Murray, MN' ,
1153 '27103' : 'Nicollet, MN' ,
1154 '27105' : 'Nobles, MN' ,
1155 '27107' : 'Norman, MN' ,
1156 '27111' : 'Otter Tail, MN' ,
1157 '27113' : 'Pennington, MN' ,
1158 '27115' : 'Pine, MN' ,
1159 '27117' : 'Pipestone, MN' ,
1160 '27121' : 'Pope, MN' ,
1161 '27125' : 'Red Lake, MN' ,
1162 '27127' : 'Redwood, MN' ,
1163 '27129' : 'Renville, MN' ,
1164 '27131' : 'Rice, MN' ,
1165 '27133' : 'Rock, MN' ,
1166 '27135' : 'Roseau, MN' ,
1167 '27143' : 'Sibley, MN' ,
1168 '27147' : 'Steele, MN' ,
1169 '27149' : 'Stevens, MN' ,
1170 '27151' : 'Swift, MN' ,
1171 '27153' : 'Todd, MN' ,
1172 '27155' : 'Traverse, MN' ,
1173 '27157' : 'Wabasha, MN' ,
1174 '27159' : 'Wadena, MN' ,
1175 '27161' : 'Waseca, MN' ,
1176 '27165' : 'Watonwan, MN' ,
1177 '27167' : 'Wilkin, MN' ,
1178 '27169' : 'Winona, MN' ,
1179 '27173' : 'Yellow Medicine, MN' ,
1180 '29000' : 'MISSOURI' ,
1181 '29001' : 'Adair, MO' ,
1182 '29005' : 'Atchison, MO' ,
1183 '29007' : 'Audrain, MO' ,
1184 '29009' : 'Barry, MO' ,
1185 '29011' : 'Barton, MO' ,
1186 '29013' : 'Bates, MO' ,
1187 '29015' : 'Benton, MO' ,
1188 '29017' : 'Bollinger, MO' ,
1189 '29023' : 'Butler, MO' ,
1190 '29025' : 'Caldwell, MO' ,
1191 '29027' : 'Callaway, MO' ,
1192 '29029' : 'Camden, MO' ,
1193 '29031' : 'Cape Girardeau, MO' ,
1194 '29033' : 'Carroll, MO' ,
1195 '29035' : 'Carter, MO' ,
1196 '29039' : 'Cedar, MO' ,
1197 '29041' : 'Chariton, MO' ,
1198 '29045' : 'Clark, MO' ,
1199 '29051' : 'Cole, MO' ,
1200 '29053' : 'Cooper, MO' ,
1201 '29055' : 'Crawford, MO' ,
1202 '29057' : 'Dade, MO' ,
1203 '29059' : 'Dallas, MO' ,
1204 '29061' : 'Daviess, MO' ,
1205 '29063' : 'De Kalb, MO' ,
1206 '29065' : 'Dent, MO' ,
1207 '29067' : 'Douglas, MO' ,
1208 '29069' : 'Dunklin, MO' ,
1209 '29073' : 'Gasconade, MO' ,
1210 '29075' : 'Gentry, MO' ,
1211 '29079' : 'Grundy, MO' ,
1212 '29081' : 'Harrison, MO' ,
1213 '29083' : 'Henry, MO' ,
1214 '29085' : 'Hickory, MO' ,
1215 '29087' : 'Holt, MO' ,
1216 '29089' : 'Howard, MO' ,
1217 '29091' : 'Howell, MO' ,
1218 '29093' : 'Iron, MO' ,
1219 '29101' : 'Johnson, MO' ,
1220 '29103' : 'Knox, MO' ,
1221 '29105' : 'Laclede, MO' ,
1222 '29109' : 'Lawrence, MO' ,
1223 '29111' : 'Lewis, MO' ,
1224 '29115' : 'Linn, MO' ,
1225 '29117' : 'Livingston, MO' ,
1226 '29119' : 'McDonald, MO' ,
1227 '29121' : 'Macon, MO' ,
1228 '29123' : 'Madison, MO' ,
1229 '29125' : 'Maries, MO' ,
1230 '29127' : 'Marion, MO' ,
1231 '29129' : 'Mercer, MO' ,
1232 '29131' : 'Miller, MO' ,
1233 '29133' : 'Mississippi, MO' ,
1234 '29135' : 'Moniteau, MO' ,
1235 '29137' : 'Monroe, MO' ,
1236 '29139' : 'Montgomery, MO' ,
1237 '29141' : 'Morgan, MO' ,
1238 '29143' : 'New Madrid, MO' ,
1239 '29147' : 'Nodaway, MO' ,
1240 '29149' : 'Oregon, MO' ,
1241 '29151' : 'Osage, MO' ,
1242 '29153' : 'Ozark, MO' ,
1243 '29155' : 'Pemiscot, MO' ,
1244 '29157' : 'Perry, MO' ,
1245 '29159' : 'Pettis, MO' ,
1246 '29161' : 'Phelps, MO' ,
1247 '29163' : 'Pike, MO' ,
1248 '29167' : 'Polk, MO' ,
1249 '29169' : 'Pulaski, MO' ,
1250 '29171' : 'Putnam, MO' ,
1251 '29173' : 'Ralls, MO' ,
1252 '29175' : 'Randolph, MO' ,
1253 '29179' : 'Reynolds, MO' ,
1254 '29181' : 'Ripley, MO' ,
1255 '29185' : 'St. Clair, MO' ,
1256 '29186' : 'Ste. Genevieve, MO' ,
1257 '29187' : 'St. Francois, MO' ,
1258 '29195' : 'Saline, MO' ,
1259 '29197' : 'Schuyler, MO' ,
1260 '29199' : 'Scotland, MO' ,
1261 '29201' : 'Scott, MO' ,
1262 '29203' : 'Shannon, MO' ,
1263 '29205' : 'Shelby, MO' ,
1264 '29207' : 'Stoddard, MO' ,
1265 '29209' : 'Stone, MO' ,
1266 '29211' : 'Sullivan, MO' ,
1267 '29213' : 'Taney, MO' ,
1268 '29215' : 'Texas, MO' ,
1269 '29217' : 'Vernon, MO' ,
1270 '29221' : 'Washington, MO' ,
1271 '29223' : 'Wayne, MO' ,
1272 '29227' : 'Worth, MO' ,
1273 '29229' : 'Wright, MO' ,
1274 '28000' : 'MISSISSIPPI' ,
1275 '28001' : 'Adams, MS' ,
1276 '28003' : 'Alcorn, MS' ,
1277 '28005' : 'Amite, MS' ,
1278 '28007' : 'Attala, MS' ,
1279 '28009' : 'Benton, MS' ,
1280 '28011' : 'Bolivar, MS' ,
1281 '28013' : 'Calhoun, MS' ,
1282 '28015' : 'Carroll, MS' ,
1283 '28017' : 'Chickasaw, MS' ,
1284 '28019' : 'Choctaw, MS' ,
1285 '28021' : 'Claiborne, MS' ,
1286 '28023' : 'Clarke, MS' ,
1287 '28025' : 'Clay, MS' ,
1288 '28027' : 'Coahoma, MS' ,
1289 '28029' : 'Copiah, MS' ,
1290 '28031' : 'Covington, MS' ,
1291 '28035' : 'Forrest, MS' ,
1292 '28037' : 'Franklin, MS' ,
1293 '28039' : 'George, MS' ,
1294 '28041' : 'Greene, MS' ,
1295 '28043' : 'Grenada, MS' ,
1296 '28051' : 'Holmes, MS' ,
1297 '28053' : 'Humphreys, MS' ,
1298 '28055' : 'Issaquena, MS' ,
1299 '28057' : 'Itawamba, MS' ,
1300 '28061' : 'Jasper, MS' ,
1301 '28063' : 'Jefferson, MS' ,
1302 '28065' : 'Jefferson Davis, MS' ,
1303 '28067' : 'Jones, MS' ,
1304 '28069' : 'Kemper, MS' ,
1305 '28071' : 'Lafayette, MS' ,
1306 '28073' : 'Lamar, MS' ,
1307 '28075' : 'Lauderdale, MS' ,
1308 '28077' : 'Lawrence, MS' ,
1309 '28079' : 'Leake, MS' ,
1310 '28081' : 'Lee, MS' ,
1311 '28083' : 'Leflore, MS' ,
1312 '28085' : 'Lincoln, MS' ,
1313 '28087' : 'Lowndes, MS' ,
1314 '28091' : 'Marion, MS' ,
1315 '28093' : 'Marshall, MS' ,
1316 '28095' : 'Monroe, MS' ,
1317 '28097' : 'Montgomery, MS' ,
1318 '28099' : 'Neshoba, MS' ,
1319 '28101' : 'Newton, MS' ,
1320 '28103' : 'Noxubee, MS' ,
1321 '28105' : 'Oktibbeha, MS' ,
1322 '28107' : 'Panola, MS' ,
1323 '28109' : 'Pearl River, MS' ,
1324 '28111' : 'Perry, MS' ,
1325 '28113' : 'Pike, MS' ,
1326 '28115' : 'Pontotoc, MS' ,
1327 '28117' : 'Prentiss, MS' ,
1328 '28119' : 'Quitman, MS' ,
1329 '28123' : 'Scott, MS' ,
1330 '28125' : 'Sharkey, MS' ,
1331 '28127' : 'Simpson, MS' ,
1332 '28129' : 'Smith, MS' ,
1333 '28131' : 'Stone, MS' ,
1334 '28133' : 'Sunflower, MS' ,
1335 '28135' : 'Tallahatchie, MS' ,
1336 '28137' : 'Tate, MS' ,
1337 '28139' : 'Tippah, MS' ,
1338 '28141' : 'Tishomingo, MS' ,
1339 '28143' : 'Tunica, MS' ,
1340 '28145' : 'Union, MS' ,
1341 '28147' : 'Walthall, MS' ,
1342 '28149' : 'Warren, MS' ,
1343 '28151' : 'Washington, MS' ,
1344 '28153' : 'Wayne, MS' ,
1345 '28155' : 'Webster, MS' ,
1346 '28157' : 'Wilkinson, MS' ,
1347 '28159' : 'Winston, MS' ,
1348 '28161' : 'Yalobusha, MS' ,
1349 '28163' : 'Yazoo, MS' ,
1350 '30000' : 'MONTANA' ,
1351 '30001' : 'Beaverhead, MT' ,
1352 '30003' : 'Big Horn, MT' ,
1353 '30005' : 'Blaine, MT' ,
1354 '30007' : 'Broadwater, MT' ,
1355 '30009' : 'Carbon, MT' ,
1356 '30011' : 'Carter, MT' ,
1357 '30015' : 'Chouteau, MT' ,
1358 '30017' : 'Custer, MT' ,
1359 '30019' : 'Daniels, MT' ,
1360 '30021' : 'Dawson, MT' ,
1361 '30023' : 'Deer Lodge, MT' ,
1362 '30025' : 'Fallon, MT' ,
1363 '30027' : 'Fergus, MT' ,
1364 '30029' : 'Flathead, MT' ,
1365 '30031' : 'Gallatin, MT' ,
1366 '30033' : 'Garfield, MT' ,
1367 '30035' : 'Glacier, MT' ,
1368 '30037' : 'Golden Valley, MT' ,
1369 '30039' : 'Granite, MT' ,
1370 '30041' : 'Hill, MT' ,
1371 '30043' : 'Jefferson, MT' ,
1372 '30045' : 'Judith Basin, MT' ,
1373 '30047' : 'Lake, MT' ,
1374 '30049' : 'Lewis and Clark, MT' ,
1375 '30051' : 'Liberty, MT' ,
1376 '30053' : 'Lincoln, MT' ,
1377 '30055' : 'McCone, MT' ,
1378 '30057' : 'Madison, MT' ,
1379 '30059' : 'Meagher, MT' ,
1380 '30061' : 'Mineral, MT' ,
1381 '30063' : 'Missoula, MT' ,
1382 '30065' : 'Musselshell, MT' ,
1383 '30067' : 'Park, MT' ,
1384 '30069' : 'Petroleum, MT' ,
1385 '30071' : 'Phillips, MT' ,
1386 '30073' : 'Pondera, MT' ,
1387 '30075' : 'Powder River, MT' ,
1388 '30077' : 'Powell, MT' ,
1389 '30079' : 'Prairie, MT' ,
1390 '30081' : 'Ravalli, MT' ,
1391 '30083' : 'Richland, MT' ,
1392 '30085' : 'Roosevelt, MT' ,
1393 '30087' : 'Rosebud, MT' ,
1394 '30089' : 'Sanders, MT' ,
1395 '30091' : 'Sheridan, MT' ,
1396 '30093' : 'Silver Bow, MT' ,
1397 '30095' : 'Stillwater, MT' ,
1398 '30097' : 'Sweet Grass, MT' ,
1399 '30099' : 'Teton, MT' ,
1400 '30101' : 'Toole, MT' ,
1401 '30103' : 'Treasure, MT' ,
1402 '30105' : 'Valley, MT' ,
1403 '30107' : 'Wheatland, MT' ,
1404 '30109' : 'Wibaux, MT' ,
1405 '30113' : 'Yellowstone National Park, MT' ,
1406 '36061' : 'New York, NY' ,
1407 '37000' : 'NORTH CAROLINA' ,
1408 '37005' : 'Alleghany, NC' ,
1409 '37007' : 'Anson, NC' ,
1410 '37009' : 'Ashe, NC' ,
1411 '37011' : 'Avery, NC' ,
1412 '37013' : 'Beaufort, NC' ,
1413 '37015' : 'Bertie, NC' ,
1414 '37017' : 'Bladen, NC' ,
1415 '37019' : 'Brunswick, NC' ,
1416 '37029' : 'Camden, NC' ,
1417 '37031' : 'Carteret, NC' ,
1418 '37033' : 'Caswell, NC' ,
1419 '37039' : 'Cherokee, NC' ,
1420 '37041' : 'Chowan, NC' ,
1421 '37043' : 'Clay, NC' ,
1422 '37045' : 'Cleveland, NC' ,
1423 '37047' : 'Columbus, NC' ,
1424 '37049' : 'Craven, NC' ,
1425 '37055' : 'Dare, NC' ,
1426 '37061' : 'Duplin, NC' ,
1427 '37073' : 'Gates, NC' ,
1428 '37075' : 'Graham, NC' ,
1429 '37077' : 'Granville, NC' ,
1430 '37079' : 'Greene, NC' ,
1431 '37083' : 'Halifax, NC' ,
1432 '37085' : 'Harnett, NC' ,
1433 '37087' : 'Haywood, NC' ,
1434 '37089' : 'Henderson, NC' ,
1435 '37091' : 'Hertford, NC' ,
1436 '37093' : 'Hoke, NC' ,
1437 '37095' : 'Hyde, NC' ,
1438 '37097' : 'Iredell, NC' ,
1439 '37099' : 'Jackson, NC' ,
1440 '37103' : 'Jones, NC' ,
1441 '37105' : 'Lee, NC' ,
1442 '37107' : 'Lenoir, NC' ,
1443 '37111' : 'McDowell, NC' ,
1444 '37113' : 'Macon, NC' ,
1445 '37117' : 'Martin, NC' ,
1446 '37121' : 'Mitchell, NC' ,
1447 '37123' : 'Montgomery, NC' ,
1448 '37125' : 'Moore, NC' ,
1449 '37131' : 'Northampton, NC' ,
1450 '37137' : 'Pamlico, NC' ,
1451 '37139' : 'Pasquotank, NC' ,
1452 '37141' : 'Pender, NC' ,
1453 '37143' : 'Perquimans, NC' ,
1454 '37145' : 'Person, NC' ,
1455 '37149' : 'Polk, NC' ,
1456 '37153' : 'Richmond, NC' ,
1457 '37155' : 'Robeson, NC' ,
1458 '37157' : 'Rockingham, NC' ,
1459 '37161' : 'Rutherford, NC' ,
1460 '37163' : 'Sampson, NC' ,
1461 '37165' : 'Scotland, NC' ,
1462 '37167' : 'Stanly, NC' ,
1463 '37171' : 'Surry, NC' ,
1464 '37173' : 'Swain, NC' ,
1465 '37175' : 'Transylvania, NC' ,
1466 '37177' : 'Tyrrell, NC' ,
1467 '37181' : 'Vance, NC' ,
1468 '37185' : 'Warren, NC' ,
1469 '37187' : 'Washington, NC' ,
1470 '37189' : 'Watauga, NC' ,
1471 '37193' : 'Wilkes, NC' ,
1472 '37195' : 'Wilson, NC' ,
1473 '37199' : 'Yancey, NC' ,
1474 '38000' : 'NORTH DAKOTA' ,
1475 '38001' : 'Adams, ND' ,
1476 '38003' : 'Barnes, ND' ,
1477 '38005' : 'Benson, ND' ,
1478 '38007' : 'Billings, ND' ,
1479 '38009' : 'Bottineau, ND' ,
1480 '38011' : 'Bowman, ND' ,
1481 '38013' : 'Burke, ND' ,
1482 '38019' : 'Cavalier, ND' ,
1483 '38021' : 'Dickey, ND' ,
1484 '38023' : 'Divide, ND' ,
1485 '38025' : 'Dunn, ND' ,
1486 '38027' : 'Eddy, ND' ,
1487 '38029' : 'Emmons, ND' ,
1488 '38031' : 'Foster, ND' ,
1489 '38033' : 'Golden Valley, ND' ,
1490 '38037' : 'Grant, ND' ,
1491 '38039' : 'Griggs, ND' ,
1492 '38041' : 'Hettinger, ND' ,
1493 '38043' : 'Kidder, ND' ,
1494 '38045' : 'La Moure, ND' ,
1495 '38047' : 'Logan, ND' ,
1496 '38049' : 'McHenry, ND' ,
1497 '38051' : 'McIntosh, ND' ,
1498 '38053' : 'McKenzie, ND' ,
1499 '38055' : 'McLean, ND' ,
1500 '38057' : 'Mercer, ND' ,
1501 '38061' : 'Mountrail, ND' ,
1502 '38063' : 'Nelson, ND' ,
1503 '38065' : 'Oliver, ND' ,
1504 '38067' : 'Pembina, ND' ,
1505 '38069' : 'Pierce, ND' ,
1506 '38071' : 'Ramsey, ND' ,
1507 '38073' : 'Ransom, ND' ,
1508 '38075' : 'Renville, ND' ,
1509 '38077' : 'Richland, ND' ,
1510 '38079' : 'Rolette, ND' ,
1511 '38081' : 'Sargent, ND' ,
1512 '38083' : 'Sheridan, ND' ,
1513 '38085' : 'Sioux, ND' ,
1514 '38087' : 'Slope, ND' ,
1515 '38089' : 'Stark, ND' ,
1516 '38091' : 'Steele, ND' ,
1517 '38093' : 'Stutsman, ND' ,
1518 '38095' : 'Towner, ND' ,
1519 '38097' : 'Traill, ND' ,
1520 '38099' : 'Walsh, ND' ,
1521 '38101' : 'Ward, ND' ,
1522 '38103' : 'Wells, ND' ,
1523 '38105' : 'Williams, ND' ,
1524 '31000' : 'NEBRASKA' ,
1525 '31001' : 'Adams, NE' ,
1526 '31003' : 'Antelope, NE' ,
1527 '31005' : 'Arthur, NE' ,
1528 '31007' : 'Banner, NE' ,
1529 '31009' : 'Blaine, NE' ,
1530 '31011' : 'Boone, NE' ,
1531 '31013' : 'Box Butte, NE' ,
1532 '31015' : 'Boyd, NE' ,
1533 '31017' : 'Brown, NE' ,
1534 '31019' : 'Buffalo, NE' ,
1535 '31021' : 'Burt, NE' ,
1536 '31023' : 'Butler, NE' ,
1537 '31027' : 'Cedar, NE' ,
1538 '31029' : 'Chase, NE' ,
1539 '31031' : 'Cherry, NE' ,
1540 '31033' : 'Cheyenne, NE' ,
1541 '31035' : 'Clay, NE' ,
1542 '31037' : 'Colfax, NE' ,
1543 '31039' : 'Cuming, NE' ,
1544 '31041' : 'Custer, NE' ,
1545 '31045' : 'Dawes, NE' ,
1546 '31047' : 'Dawson, NE' ,
1547 '31049' : 'Deuel, NE' ,
1548 '31051' : 'Dixon, NE' ,
1549 '31053' : 'Dodge, NE' ,
1550 '31057' : 'Dundy, NE' ,
1551 '31059' : 'Fillmore, NE' ,
1552 '31061' : 'Franklin, NE' ,
1553 '31063' : 'Frontier, NE' ,
1554 '31065' : 'Furnas, NE' ,
1555 '31067' : 'Gage, NE' ,
1556 '31069' : 'Garden, NE' ,
1557 '31071' : 'Garfield, NE' ,
1558 '31073' : 'Gosper, NE' ,
1559 '31075' : 'Grant, NE' ,
1560 '31077' : 'Greeley, NE' ,
1561 '31079' : 'Hall, NE' ,
1562 '31081' : 'Hamilton, NE' ,
1563 '31083' : 'Harlan, NE' ,
1564 '31085' : 'Hayes, NE' ,
1565 '31087' : 'Hitchcock, NE' ,
1566 '31089' : 'Holt, NE' ,
1567 '31091' : 'Hooker, NE' ,
1568 '31093' : 'Howard, NE' ,
1569 '31095' : 'Jefferson, NE' ,
1570 '31097' : 'Johnson, NE' ,
1571 '31099' : 'Kearney, NE' ,
1572 '31101' : 'Keith, NE' ,
1573 '31103' : 'Keya Paha, NE' ,
1574 '31105' : 'Kimball, NE' ,
1575 '31107' : 'Knox, NE' ,
1576 '31111' : 'Lincoln, NE' ,
1577 '31113' : 'Logan, NE' ,
1578 '31115' : 'Loup, NE' ,
1579 '31117' : 'McPherson, NE' ,
1580 '31119' : 'Madison, NE' ,
1581 '31121' : 'Merrick, NE' ,
1582 '31123' : 'Morrill, NE' ,
1583 '31125' : 'Nance, NE' ,
1584 '31127' : 'Nemaha, NE' ,
1585 '31129' : 'Nuckolls, NE' ,
1586 '31131' : 'Otoe, NE' ,
1587 '31133' : 'Pawnee, NE' ,
1588 '31135' : 'Perkins, NE' ,
1589 '31137' : 'Phelps, NE' ,
1590 '31139' : 'Pierce, NE' ,
1591 '31141' : 'Platte, NE' ,
1592 '31143' : 'Polk, NE' ,
1593 '31145' : 'Red Willow, NE' ,
1594 '31147' : 'Richardson, NE' ,
1595 '31149' : 'Rock, NE' ,
1596 '31151' : 'Saline, NE' ,
1597 '31155' : 'Saunders, NE' ,
1598 '31157' : 'Scotts Bluff, NE' ,
1599 '31159' : 'Seward, NE' ,
1600 '31161' : 'Sheridan, NE' ,
1601 '31163' : 'Sherman, NE' ,
1602 '31165' : 'Sioux, NE' ,
1603 '31167' : 'Stanton, NE' ,
1604 '31169' : 'Thayer, NE' ,
1605 '31171' : 'Thomas, NE' ,
1606 '31173' : 'Thurston, NE' ,
1607 '31175' : 'Valley, NE' ,
1608 '31179' : 'Wayne, NE' ,
1609 '31181' : 'Webster, NE' ,
1610 '31183' : 'Wheeler, NE' ,
1611 '31185' : 'York, NE' ,
1612 '33000' : 'NEW HAMPSHIRE' ,
1613 '33001' : 'Belknap, NH' ,
1614 '33003' : 'Carroll, NH' ,
1615 '33005' : 'Cheshire, NH' ,
1616 '33007' : 'Coos, NH' ,
1617 '33009' : 'Grafton, NH' ,
1618 '33013' : 'Merrimack, NH' ,
1619 '33019' : 'Sullivan, NH' ,
1620 '34000' : 'NEW JERSEY' ,
1621 '35000' : 'NEW MEXICO' ,
1622 '35003' : 'Catron, NM' ,
1623 '35005' : 'Chaves, NM' ,
1624 '35006' : 'Cibola, NM' ,
1625 '35007' : 'Colfax, NM' ,
1626 '35009' : 'Curry, NM' ,
1627 '35011' : 'De Baca, NM' ,
1628 '35015' : 'Eddy, NM' ,
1629 '35017' : 'Grant, NM' ,
1630 '35019' : 'Guadalupe, NM' ,
1631 '35021' : 'Harding, NM' ,
1632 '35023' : 'Hidalgo, NM' ,
1633 '35025' : 'Lea, NM' ,
1634 '35027' : 'Lincoln, NM' ,
1635 '35029' : 'Luna, NM' ,
1636 '35031' : 'McKinley, NM' ,
1637 '35033' : 'Mora, NM' ,
1638 '35035' : 'Otero, NM' ,
1639 '35037' : 'Quay, NM' ,
1640 '35039' : 'Rio Arriba, NM' ,
1641 '35041' : 'Roosevelt, NM' ,
1642 '35045' : 'San Juan, NM' ,
1643 '35047' : 'San Miguel, NM' ,
1644 '35051' : 'Sierra, NM' ,
1645 '35053' : 'Socorro, NM' ,
1646 '35055' : 'Taos, NM' ,
1647 '35057' : 'Torrance, NM' ,
1648 '35059' : 'Union, NM' ,
1649 '32000' : 'NEVADA' ,
1650 '32001' : 'Churchill, NV' ,
1651 '32005' : 'Douglas, NV' ,
1652 '32007' : 'Elko, NV' ,
1653 '32009' : 'Esmeralda, NV' ,
1654 '32011' : 'Eureka, NV' ,
1655 '32013' : 'Humboldt, NV' ,
1656 '32015' : 'Lander, NV' ,
1657 '32017' : 'Lincoln, NV' ,
1658 '32019' : 'Lyon, NV' ,
1659 '32021' : 'Mineral, NV' ,
1660 '32027' : 'Pershing, NV' ,
1661 '32029' : 'Storey, NV' ,
1662 '32033' : 'White Pine, NV' ,
1663 '32510' : 'Carson City city, NV' ,
1664 '36000' : 'NEW YORK' ,
1665 '36003' : 'Allegany, NY' ,
1666 '36009' : 'Cattaraugus, NY' ,
1667 '36017' : 'Chenango, NY' ,
1668 '36019' : 'Clinton, NY' ,
1669 '36021' : 'Columbia, NY' ,
1670 '36023' : 'Cortland, NY' ,
1671 '36025' : 'Delaware, NY' ,
1672 '36031' : 'Essex, NY' ,
1673 '36033' : 'Franklin, NY' ,
1674 '36035' : 'Fulton, NY' ,
1675 '36039' : 'Greene, NY' ,
1676 '36041' : 'Hamilton, NY' ,
1677 '36045' : 'Jefferson, NY' ,
1678 '36049' : 'Lewis, NY' ,
1679 '36077' : 'Otsego, NY' ,
1680 '36089' : 'St. Lawrence, NY' ,
1681 '36097' : 'Schuyler, NY' ,
1682 '36099' : 'Seneca, NY' ,
1683 '36101' : 'Steuben, NY' ,
1684 '36105' : 'Sullivan, NY' ,
1685 '36109' : 'Tompkins, NY' ,
1686 '36111' : 'Ulster, NY' ,
1687 '36121' : 'Wyoming, NY' ,
1688 '36123' : 'Yates, NY' ,
1689 '39000' : 'OHIO' ,
1690 '39001' : 'Adams, OH' ,
1691 '39005' : 'Ashland, OH' ,
1692 '39009' : 'Athens, OH' ,
1693 '39021' : 'Champaign, OH' ,
1694 '39027' : 'Clinton, OH' ,
1695 '39031' : 'Coshocton, OH' ,
1696 '39037' : 'Darke, OH' ,
1697 '39039' : 'Defiance, OH' ,
1698 '39043' : 'Erie, OH' ,
1699 '39047' : 'Fayette, OH' ,
1700 '39053' : 'Gallia, OH' ,
1701 '39059' : 'Guernsey, OH' ,
1702 '39063' : 'Hancock, OH' ,
1703 '39065' : 'Hardin, OH' ,
1704 '39067' : 'Harrison, OH' ,
1705 '39069' : 'Henry, OH' ,
1706 '39071' : 'Highland, OH' ,
1707 '39073' : 'Hocking, OH' ,
1708 '39075' : 'Holmes, OH' ,
1709 '39077' : 'Huron, OH' ,
1710 '39079' : 'Jackson, OH' ,
1711 '39083' : 'Knox, OH' ,
1712 '39091' : 'Logan, OH' ,
1713 '39101' : 'Marion, OH' ,
1714 '39105' : 'Meigs, OH' ,
1715 '39107' : 'Mercer, OH' ,
1716 '39111' : 'Monroe, OH' ,
1717 '39115' : 'Morgan, OH' ,
1718 '39117' : 'Morrow, OH' ,
1719 '39119' : 'Muskingum, OH' ,
1720 '39121' : 'Noble, OH' ,
1721 '39123' : 'Ottawa, OH' ,
1722 '39125' : 'Paulding, OH' ,
1723 '39127' : 'Perry, OH' ,
1724 '39131' : 'Pike, OH' ,
1725 '39135' : 'Preble, OH' ,
1726 '39137' : 'Putnam, OH' ,
1727 '39141' : 'Ross, OH' ,
1728 '39143' : 'Sandusky, OH' ,
1729 '39145' : 'Scioto, OH' ,
1730 '39147' : 'Seneca, OH' ,
1731 '39149' : 'Shelby, OH' ,
1732 '39157' : 'Tuscarawas, OH' ,
1733 '39159' : 'Union, OH' ,
1734 '39161' : 'Van Wert, OH' ,
1735 '39163' : 'Vinton, OH' ,
1736 '39169' : 'Wayne, OH' ,
1737 '39171' : 'Williams, OH' ,
1738 '39175' : 'Wyandot, OH' ,
1739 '40000' : 'OKLAHOMA' ,
1740 '40001' : 'Adair, OK' ,
1741 '40003' : 'Alfalfa, OK' ,
1742 '40005' : 'Atoka, OK' ,
1743 '40007' : 'Beaver, OK' ,
1744 '40009' : 'Beckham, OK' ,
1745 '40011' : 'Blaine, OK' ,
1746 '40013' : 'Bryan, OK' ,
1747 '40015' : 'Caddo, OK' ,
1748 '40019' : 'Carter, OK' ,
1749 '40021' : 'Cherokee, OK' ,
1750 '40023' : 'Choctaw, OK' ,
1751 '40025' : 'Cimarron, OK' ,
1752 '40029' : 'Coal, OK' ,
1753 '40033' : 'Cotton, OK' ,
1754 '40035' : 'Craig, OK' ,
1755 '40039' : 'Custer, OK' ,
1756 '40041' : 'Delaware, OK' ,
1757 '40043' : 'Dewey, OK' ,
1758 '40045' : 'Ellis, OK' ,
1759 '40049' : 'Garvin, OK' ,
1760 '40051' : 'Grady, OK' ,
1761 '40053' : 'Grant, OK' ,
1762 '40055' : 'Greer, OK' ,
1763 '40057' : 'Harmon, OK' ,
1764 '40059' : 'Harper, OK' ,
1765 '40061' : 'Haskell, OK' ,
1766 '40063' : 'Hughes, OK' ,
1767 '40065' : 'Jackson, OK' ,
1768 '40067' : 'Jefferson, OK' ,
1769 '40069' : 'Johnston, OK' ,
1770 '40071' : 'Kay, OK' ,
1771 '40073' : 'Kingfisher, OK' ,
1772 '40075' : 'Kiowa, OK' ,
1773 '40077' : 'Latimer, OK' ,
1774 '40079' : 'Le Flore, OK' ,
1775 '40081' : 'Lincoln, OK' ,
1776 '40085' : 'Love, OK' ,
1777 '40089' : 'McCurtain, OK' ,
1778 '40091' : 'McIntosh, OK' ,
1779 '40093' : 'Major, OK' ,
1780 '40095' : 'Marshall, OK' ,
1781 '40097' : 'Mayes, OK' ,
1782 '40099' : 'Murray, OK' ,
1783 '40101' : 'Muskogee, OK' ,
1784 '40103' : 'Noble, OK' ,
1785 '40105' : 'Nowata, OK' ,
1786 '40107' : 'Okfuskee, OK' ,
1787 '40111' : 'Okmulgee, OK' ,
1788 '40115' : 'Ottawa, OK' ,
1789 '40117' : 'Pawnee, OK' ,
1790 '40119' : 'Payne, OK' ,
1791 '40121' : 'Pittsburg, OK' ,
1792 '40123' : 'Pontotoc, OK' ,
1793 '40127' : 'Pushmataha, OK' ,
1794 '40129' : 'Roger Mills, OK' ,
1795 '40133' : 'Seminole, OK' ,
1796 '40137' : 'Stephens, OK' ,
1797 '40139' : 'Texas, OK' ,
1798 '40141' : 'Tillman, OK' ,
1799 '40147' : 'Washington, OK' ,
1800 '40149' : 'Washita, OK' ,
1801 '40151' : 'Woods, OK' ,
1802 '40153' : 'Woodward, OK' ,
1803 '41000' : 'OREGON' ,
1804 '41001' : 'Baker, OR' ,
1805 '41003' : 'Benton, OR' ,
1806 '41007' : 'Clatsop, OR' ,
1807 '41011' : 'Coos, OR' ,
1808 '41013' : 'Crook, OR' ,
1809 '41015' : 'Curry, OR' ,
1810 '41017' : 'Deschutes, OR' ,
1811 '41019' : 'Douglas, OR' ,
1812 '41021' : 'Gilliam, OR' ,
1813 '41023' : 'Grant, OR' ,
1814 '41025' : 'Harney, OR' ,
1815 '41027' : 'Hood River, OR' ,
1816 '41031' : 'Jefferson, OR' ,
1817 '41033' : 'Josephine, OR' ,
1818 '41035' : 'Klamath, OR' ,
1819 '41037' : 'Lake, OR' ,
1820 '41041' : 'Lincoln, OR' ,
1821 '41043' : 'Linn, OR' ,
1822 '41045' : 'Malheur, OR' ,
1823 '41049' : 'Morrow, OR' ,
1824 '41055' : 'Sherman, OR' ,
1825 '41057' : 'Tillamook, OR' ,
1826 '41059' : 'Umatilla, OR' ,
1827 '41061' : 'Union, OR' ,
1828 '41063' : 'Wallowa, OR' ,
1829 '41065' : 'Wasco, OR' ,
1830 '41069' : 'Wheeler, OR' ,
1831 '42000' : 'PENNSYLVANIA' ,
1832 '42001' : 'Adams, PA' ,
1833 '42005' : 'Armstrong, PA' ,
1834 '42009' : 'Bedford, PA' ,
1835 '42015' : 'Bradford, PA' ,
1836 '42023' : 'Cameron, PA' ,
1837 '42031' : 'Clarion, PA' ,
1838 '42033' : 'Clearfield, PA' ,
1839 '42035' : 'Clinton, PA' ,
1840 '42039' : 'Crawford, PA' ,
1841 '42047' : 'Elk, PA' ,
1842 '42053' : 'Forest, PA' ,
1843 '42055' : 'Franklin, PA' ,
1844 '42057' : 'Fulton, PA' ,
1845 '42059' : 'Greene, PA' ,
1846 '42061' : 'Huntingdon, PA' ,
1847 '42063' : 'Indiana, PA' ,
1848 '42065' : 'Jefferson, PA' ,
1849 '42067' : 'Juniata, PA' ,
1850 '42073' : 'Lawrence, PA' ,
1851 '42083' : 'McKean, PA' ,
1852 '42087' : 'Mifflin, PA' ,
1853 '42089' : 'Monroe, PA' ,
1854 '42093' : 'Montour, PA' ,
1855 '42097' : 'Northumberland, PA' ,
1856 '42105' : 'Potter, PA' ,
1857 '42107' : 'Schuylkill, PA' ,
1858 '42109' : 'Snyder, PA' ,
1859 '42113' : 'Sullivan, PA' ,
1860 '42115' : 'Susquehanna, PA' ,
1861 '42117' : 'Tioga, PA' ,
1862 '42119' : 'Union, PA' ,
1863 '42121' : 'Venango, PA' ,
1864 '42123' : 'Warren, PA' ,
1865 '42127' : 'Wayne, PA' ,
1866 '44000' : 'RHODE ISLAND' ,
1867 '44005' : 'Newport, RI' ,
1868 '45000' : 'SOUTH CAROLINA' ,
1869 '45001' : 'Abbeville, SC' ,
1870 '45005' : 'Allendale, SC' ,
1871 '45009' : 'Bamberg, SC' ,
1872 '45011' : 'Barnwell, SC' ,
1873 '45013' : 'Beaufort, SC' ,
1874 '45017' : 'Calhoun, SC' ,
1875 '45023' : 'Chester, SC' ,
1876 '45025' : 'Chesterfield, SC' ,
1877 '45027' : 'Clarendon, SC' ,
1878 '45029' : 'Colleton, SC' ,
1879 '45031' : 'Darlington, SC' ,
1880 '45033' : 'Dillon, SC' ,
1881 '45039' : 'Fairfield, SC' ,
1882 '45043' : 'Georgetown, SC' ,
1883 '45047' : 'Greenwood, SC' ,
1884 '45049' : 'Hampton, SC' ,
1885 '45053' : 'Jasper, SC' ,
1886 '45055' : 'Kershaw, SC' ,
1887 '45057' : 'Lancaster, SC' ,
1888 '45059' : 'Laurens, SC' ,
1889 '45061' : 'Lee, SC' ,
1890 '45065' : 'McCormick, SC' ,
1891 '45067' : 'Marion, SC' ,
1892 '45069' : 'Marlboro, SC' ,
1893 '45071' : 'Newberry, SC' ,
1894 '45073' : 'Oconee, SC' ,
1895 '45075' : 'Orangeburg, SC' ,
1896 '45081' : 'Saluda, SC' ,
1897 '45087' : 'Union, SC' ,
1898 '45089' : 'Williamsburg, SC' ,
1899 '46000' : 'SOUTH DAKOTA' ,
1900 '46003' : 'Aurora, SD' ,
1901 '46005' : 'Beadle, SD' ,
1902 '46007' : 'Bennett, SD' ,
1903 '46009' : 'Bon Homme, SD' ,
1904 '46011' : 'Brookings, SD' ,
1905 '46013' : 'Brown, SD' ,
1906 '46015' : 'Brule, SD' ,
1907 '46017' : 'Buffalo, SD' ,
1908 '46019' : 'Butte, SD' ,
1909 '46021' : 'Campbell, SD' ,
1910 '46023' : 'Charles Mix, SD' ,
1911 '46025' : 'Clark, SD' ,
1912 '46027' : 'Clay, SD' ,
1913 '46029' : 'Codington, SD' ,
1914 '46031' : 'Corson, SD' ,
1915 '46033' : 'Custer, SD' ,
1916 '46035' : 'Davison, SD' ,
1917 '46037' : 'Day, SD' ,
1918 '46039' : 'Deuel, SD' ,
1919 '46041' : 'Dewey, SD' ,
1920 '46043' : 'Douglas, SD' ,
1921 '46045' : 'Edmunds, SD' ,
1922 '46047' : 'Fall River, SD' ,
1923 '46049' : 'Faulk, SD' ,
1924 '46051' : 'Grant, SD' ,
1925 '46053' : 'Gregory, SD' ,
1926 '46055' : 'Haakon, SD' ,
1927 '46057' : 'Hamlin, SD' ,
1928 '46059' : 'Hand, SD' ,
1929 '46061' : 'Hanson, SD' ,
1930 '46063' : 'Harding, SD' ,
1931 '46065' : 'Hughes, SD' ,
1932 '46067' : 'Hutchinson, SD' ,
1933 '46069' : 'Hyde, SD' ,
1934 '46071' : 'Jackson, SD' ,
1935 '46073' : 'Jerauld, SD' ,
1936 '46075' : 'Jones, SD' ,
1937 '46077' : 'Kingsbury, SD' ,
1938 '46079' : 'Lake, SD' ,
1939 '46081' : 'Lawrence, SD' ,
1940 '46085' : 'Lyman, SD' ,
1941 '46087' : 'McCook, SD' ,
1942 '46089' : 'McPherson, SD' ,
1943 '46091' : 'Marshall, SD' ,
1944 '46093' : 'Meade, SD' ,
1945 '46095' : 'Mellette, SD' ,
1946 '46097' : 'Miner, SD' ,
1947 '46101' : 'Moody, SD' ,
1948 '46105' : 'Perkins, SD' ,
1949 '46107' : 'Potter, SD' ,
1950 '46109' : 'Roberts, SD' ,
1951 '46111' : 'Sanborn, SD' ,
1952 '46113' : 'Shannon, SD' ,
1953 '46115' : 'Spink, SD' ,
1954 '46117' : 'Stanley, SD' ,
1955 '46119' : 'Sully, SD' ,
1956 '46121' : 'Todd, SD' ,
1957 '46123' : 'Tripp, SD' ,
1958 '46125' : 'Turner, SD' ,
1959 '46127' : 'Union, SD' ,
1960 '46129' : 'Walworth, SD' ,
1961 '46135' : 'Yankton, SD' ,
1962 '46137' : 'Ziebach, SD' ,
1963 '47000' : 'TENNESSEE' ,
1964 '47003' : 'Bedford, TN' ,
1965 '47005' : 'Benton, TN' ,
1966 '47007' : 'Bledsoe, TN' ,
1967 '47011' : 'Bradley, TN' ,
1968 '47013' : 'Campbell, TN' ,
1969 '47015' : 'Cannon, TN' ,
1970 '47017' : 'Carroll, TN' ,
1971 '47023' : 'Chester, TN' ,
1972 '47025' : 'Claiborne, TN' ,
1973 '47027' : 'Clay, TN' ,
1974 '47029' : 'Cocke, TN' ,
1975 '47031' : 'Coffee, TN' ,
1976 '47033' : 'Crockett, TN' ,
1977 '47035' : 'Cumberland, TN' ,
1978 '47039' : 'Decatur, TN' ,
1979 '47041' : 'DeKalb, TN' ,
1980 '47045' : 'Dyer, TN' ,
1981 '47049' : 'Fentress, TN' ,
1982 '47051' : 'Franklin, TN' ,
1983 '47053' : 'Gibson, TN' ,
1984 '47055' : 'Giles, TN' ,
1985 '47057' : 'Grainger, TN' ,
1986 '47059' : 'Greene, TN' ,
1987 '47061' : 'Grundy, TN' ,
1988 '47063' : 'Hamblen, TN' ,
1989 '47067' : 'Hancock, TN' ,
1990 '47069' : 'Hardeman, TN' ,
1991 '47071' : 'Hardin, TN' ,
1992 '47075' : 'Haywood, TN' ,
1993 '47077' : 'Henderson, TN' ,
1994 '47079' : 'Henry, TN' ,
1995 '47081' : 'Hickman, TN' ,
1996 '47083' : 'Houston, TN' ,
1997 '47085' : 'Humphreys, TN' ,
1998 '47087' : 'Jackson, TN' ,
1999 '47089' : 'Jefferson, TN' ,
2000 '47091' : 'Johnson, TN' ,
2001 '47095' : 'Lake, TN' ,
2002 '47097' : 'Lauderdale, TN' ,
2003 '47099' : 'Lawrence, TN' ,
2004 '47101' : 'Lewis, TN' ,
2005 '47103' : 'Lincoln, TN' ,
2006 '47107' : 'McMinn, TN' ,
2007 '47109' : 'McNairy, TN' ,
2008 '47111' : 'Macon, TN' ,
2009 '47113' : 'Madison, TN' ,
2010 '47115' : 'Marion, TN' ,
2011 '47117' : 'Marshall, TN' ,
2012 '47119' : 'Maury, TN' ,
2013 '47121' : 'Meigs, TN' ,
2014 '47123' : 'Monroe, TN' ,
2015 '47127' : 'Moore, TN' ,
2016 '47129' : 'Morgan, TN' ,
2017 '47131' : 'Obion, TN' ,
2018 '47133' : 'Overton, TN' ,
2019 '47135' : 'Perry, TN' ,
2020 '47137' : 'Pickett, TN' ,
2021 '47139' : 'Polk, TN' ,
2022 '47141' : 'Putnam, TN' ,
2023 '47143' : 'Rhea, TN' ,
2024 '47145' : 'Roane, TN' ,
2025 '47151' : 'Scott, TN' ,
2026 '47153' : 'Sequatchie, TN' ,
2027 '47159' : 'Smith, TN' ,
2028 '47161' : 'Stewart, TN' ,
2029 '47169' : 'Trousdale, TN' ,
2030 '47175' : 'Van Buren, TN' ,
2031 '47177' : 'Warren, TN' ,
2032 '47181' : 'Wayne, TN' ,
2033 '47183' : 'Weakley, TN' ,
2034 '47185' : 'White, TN' ,
2035 '48000' : 'TEXAS' ,
2036 '48001' : 'Anderson, TX' ,
2037 '48003' : 'Andrews, TX' ,
2038 '48005' : 'Angelina, TX' ,
2039 '48007' : 'Aransas, TX' ,
2040 '48011' : 'Armstrong, TX' ,
2041 '48013' : 'Atascosa, TX' ,
2042 '48015' : 'Austin, TX' ,
2043 '48017' : 'Bailey, TX' ,
2044 '48019' : 'Bandera, TX' ,
2045 '48023' : 'Baylor, TX' ,
2046 '48025' : 'Bee, TX' ,
2047 '48031' : 'Blanco, TX' ,
2048 '48033' : 'Borden, TX' ,
2049 '48035' : 'Bosque, TX' ,
2050 '48043' : 'Brewster, TX' ,
2051 '48045' : 'Briscoe, TX' ,
2052 '48047' : 'Brooks, TX' ,
2053 '48049' : 'Brown, TX' ,
2054 '48051' : 'Burleson, TX' ,
2055 '48053' : 'Burnet, TX' ,
2056 '48057' : 'Calhoun, TX' ,
2057 '48059' : 'Callahan, TX' ,
2058 '48063' : 'Camp, TX' ,
2059 '48065' : 'Carson, TX' ,
2060 '48067' : 'Cass, TX' ,
2061 '48069' : 'Castro, TX' ,
2062 '48073' : 'Cherokee, TX' ,
2063 '48075' : 'Childress, TX' ,
2064 '48077' : 'Clay, TX' ,
2065 '48079' : 'Cochran, TX' ,
2066 '48081' : 'Coke, TX' ,
2067 '48083' : 'Coleman, TX' ,
2068 '48087' : 'Collingsworth, TX' ,
2069 '48089' : 'Colorado, TX' ,
2070 '48093' : 'Comanche, TX' ,
2071 '48095' : 'Concho, TX' ,
2072 '48097' : 'Cooke, TX' ,
2073 '48101' : 'Cottle, TX' ,
2074 '48103' : 'Crane, TX' ,
2075 '48105' : 'Crockett, TX' ,
2076 '48107' : 'Crosby, TX' ,
2077 '48109' : 'Culberson, TX' ,
2078 '48111' : 'Dallam, TX' ,
2079 '48115' : 'Dawson, TX' ,
2080 '48117' : 'Deaf Smith, TX' ,
2081 '48119' : 'Delta, TX' ,
2082 '48123' : 'De Witt, TX' ,
2083 '48125' : 'Dickens, TX' ,
2084 '48127' : 'Dimmit, TX' ,
2085 '48129' : 'Donley, TX' ,
2086 '48131' : 'Duval, TX' ,
2087 '48133' : 'Eastland, TX' ,
2088 '48137' : 'Edwards, TX' ,
2089 '48143' : 'Erath, TX' ,
2090 '48145' : 'Falls, TX' ,
2091 '48147' : 'Fannin, TX' ,
2092 '48149' : 'Fayette, TX' ,
2093 '48151' : 'Fisher, TX' ,
2094 '48153' : 'Floyd, TX' ,
2095 '48155' : 'Foard, TX' ,
2096 '48159' : 'Franklin, TX' ,
2097 '48161' : 'Freestone, TX' ,
2098 '48163' : 'Frio, TX' ,
2099 '48165' : 'Gaines, TX' ,
2100 '48169' : 'Garza, TX' ,
2101 '48171' : 'Gillespie, TX' ,
2102 '48173' : 'Glasscock, TX' ,
2103 '48175' : 'Goliad, TX' ,
2104 '48177' : 'Gonzales, TX' ,
2105 '48179' : 'Gray, TX' ,
2106 '48185' : 'Grimes, TX' ,
2107 '48189' : 'Hale, TX' ,
2108 '48191' : 'Hall, TX' ,
2109 '48193' : 'Hamilton, TX' ,
2110 '48195' : 'Hansford, TX' ,
2111 '48197' : 'Hardeman, TX' ,
2112 '48205' : 'Hartley, TX' ,
2113 '48207' : 'Haskell, TX' ,
2114 '48211' : 'Hemphill, TX' ,
2115 '48217' : 'Hill, TX' ,
2116 '48219' : 'Hockley, TX' ,
2117 '48223' : 'Hopkins, TX' ,
2118 '48225' : 'Houston, TX' ,
2119 '48227' : 'Howard, TX' ,
2120 '48229' : 'Hudspeth, TX' ,
2121 '48233' : 'Hutchinson, TX' ,
2122 '48235' : 'Irion, TX' ,
2123 '48237' : 'Jack, TX' ,
2124 '48239' : 'Jackson, TX' ,
2125 '48241' : 'Jasper, TX' ,
2126 '48243' : 'Jeff Davis, TX' ,
2127 '48247' : 'Jim Hogg, TX' ,
2128 '48249' : 'Jim Wells, TX' ,
2129 '48253' : 'Jones, TX' ,
2130 '48255' : 'Karnes, TX' ,
2131 '48259' : 'Kendall, TX' ,
2132 '48261' : 'Kenedy, TX' ,
2133 '48263' : 'Kent, TX' ,
2134 '48265' : 'Kerr, TX' ,
2135 '48267' : 'Kimble, TX' ,
2136 '48269' : 'King, TX' ,
2137 '48271' : 'Kinney, TX' ,
2138 '48273' : 'Kleberg, TX' ,
2139 '48275' : 'Knox, TX' ,
2140 '48277' : 'Lamar, TX' ,
2141 '48279' : 'Lamb, TX' ,
2142 '48281' : 'Lampasas, TX' ,
2143 '48283' : 'La Salle, TX' ,
2144 '48285' : 'Lavaca, TX' ,
2145 '48287' : 'Lee, TX' ,
2146 '48289' : 'Leon, TX' ,
2147 '48293' : 'Limestone, TX' ,
2148 '48295' : 'Lipscomb, TX' ,
2149 '48297' : 'Live Oak, TX' ,
2150 '48299' : 'Llano, TX' ,
2151 '48301' : 'Loving, TX' ,
2152 '48305' : 'Lynn, TX' ,
2153 '48307' : 'McCulloch, TX' ,
2154 '48311' : 'McMullen, TX' ,
2155 '48313' : 'Madison, TX' ,
2156 '48315' : 'Marion, TX' ,
2157 '48317' : 'Martin, TX' ,
2158 '48319' : 'Mason, TX' ,
2159 '48321' : 'Matagorda, TX' ,
2160 '48323' : 'Maverick, TX' ,
2161 '48325' : 'Medina, TX' ,
2162 '48327' : 'Menard, TX' ,
2163 '48331' : 'Milam, TX' ,
2164 '48333' : 'Mills, TX' ,
2165 '48335' : 'Mitchell, TX' ,
2166 '48337' : 'Montague, TX' ,
2167 '48341' : 'Moore, TX' ,
2168 '48343' : 'Morris, TX' ,
2169 '48345' : 'Motley, TX' ,
2170 '48347' : 'Nacogdoches, TX' ,
2171 '48349' : 'Navarro, TX' ,
2172 '48351' : 'Newton, TX' ,
2173 '48353' : 'Nolan, TX' ,
2174 '48357' : 'Ochiltree, TX' ,
2175 '48359' : 'Oldham, TX' ,
2176 '48363' : 'Palo Pinto, TX' ,
2177 '48365' : 'Panola, TX' ,
2178 '48369' : 'Parmer, TX' ,
2179 '48371' : 'Pecos, TX' ,
2180 '48373' : 'Polk, TX' ,
2181 '48377' : 'Presidio, TX' ,
2182 '48379' : 'Rains, TX' ,
2183 '48383' : 'Reagan, TX' ,
2184 '48385' : 'Real, TX' ,
2185 '48387' : 'Red River, TX' ,
2186 '48389' : 'Reeves, TX' ,
2187 '48391' : 'Refugio, TX' ,
2188 '48393' : 'Roberts, TX' ,
2189 '48395' : 'Robertson, TX' ,
2190 '48399' : 'Runnels, TX' ,
2191 '48401' : 'Rusk, TX' ,
2192 '48403' : 'Sabine, TX' ,
2193 '48405' : 'San Augustine, TX' ,
2194 '48407' : 'San Jacinto, TX' ,
2195 '48411' : 'San Saba, TX' ,
2196 '48413' : 'Schleicher, TX' ,
2197 '48415' : 'Scurry, TX' ,
2198 '48417' : 'Shackelford, TX' ,
2199 '48419' : 'Shelby, TX' ,
2200 '48421' : 'Sherman, TX' ,
2201 '48425' : 'Somervell, TX' ,
2202 '48427' : 'Starr, TX' ,
2203 '48429' : 'Stephens, TX' ,
2204 '48431' : 'Sterling, TX' ,
2205 '48433' : 'Stonewall, TX' ,
2206 '48435' : 'Sutton, TX' ,
2207 '48437' : 'Swisher, TX' ,
2208 '48443' : 'Terrell, TX' ,
2209 '48445' : 'Terry, TX' ,
2210 '48447' : 'Throckmorton, TX' ,
2211 '48449' : 'Titus, TX' ,
2212 '48455' : 'Trinity, TX' ,
2213 '48457' : 'Tyler, TX' ,
2214 '48461' : 'Upton, TX' ,
2215 '48463' : 'Uvalde, TX' ,
2216 '48465' : 'Val Verde, TX' ,
2217 '48467' : 'Van Zandt, TX' ,
2218 '48471' : 'Walker, TX' ,
2219 '48475' : 'Ward, TX' ,
2220 '48477' : 'Washington, TX' ,
2221 '48481' : 'Wharton, TX' ,
2222 '48483' : 'Wheeler, TX' ,
2223 '48487' : 'Wilbarger, TX' ,
2224 '48489' : 'Willacy, TX' ,
2225 '48495' : 'Winkler, TX' ,
2226 '48497' : 'Wise, TX' ,
2227 '48499' : 'Wood, TX' ,
2228 '48501' : 'Yoakum, TX' ,
2229 '48503' : 'Young, TX' ,
2230 '48505' : 'Zapata, TX' ,
2231 '48507' : 'Zavala, TX' ,
2232 '49000' : 'UTAH' ,
2233 '49001' : 'Beaver, UT' ,
2234 '49003' : 'Box Elder, UT' ,
2235 '49005' : 'Cache, UT' ,
2236 '49007' : 'Carbon, UT' ,
2237 '49009' : 'Daggett, UT' ,
2238 '49013' : 'Duchesne, UT' ,
2239 '49015' : 'Emery, UT' ,
2240 '49017' : 'Garfield, UT' ,
2241 '49019' : 'Grand, UT' ,
2242 '49021' : 'Iron, UT' ,
2243 '49023' : 'Juab, UT' ,
2244 '49025' : 'Kane, UT' ,
2245 '49027' : 'Millard, UT' ,
2246 '49029' : 'Morgan, UT' ,
2247 '49031' : 'Piute, UT' ,
2248 '49033' : 'Rich, UT' ,
2249 '49037' : 'San Juan, UT' ,
2250 '49039' : 'Sanpete, UT' ,
2251 '49041' : 'Sevier, UT' ,
2252 '49043' : 'Summit, UT' ,
2253 '49045' : 'Tooele, UT' ,
2254 '49047' : 'Uintah, UT' ,
2255 '49051' : 'Wasatch, UT' ,
2256 '49053' : 'Washington, UT' ,
2257 '49055' : 'Wayne, UT' ,
2258 '51000' : 'VIRGINIA' ,
2259 '51001' : 'Accomack, VA' ,
2260 '51005' : 'Alleghany, VA' ,
2261 '51007' : 'Amelia, VA' ,
2262 '51011' : 'Appomattox, VA' ,
2263 '51015' : 'Augusta, VA' ,
2264 '51017' : 'Bath, VA' ,
2265 '51021' : 'Bland, VA' ,
2266 '51025' : 'Brunswick, VA' ,
2267 '51027' : 'Buchanan, VA' ,
2268 '51029' : 'Buckingham, VA' ,
2269 '51033' : 'Caroline, VA' ,
2270 '51035' : 'Carroll, VA' ,
2271 '51037' : 'Charlotte, VA' ,
2272 '51045' : 'Craig, VA' ,
2273 '51049' : 'Cumberland, VA' ,
2274 '51051' : 'Dickenson, VA' ,
2275 '51057' : 'Essex, VA' ,
2276 '51063' : 'Floyd, VA' ,
2277 '51067' : 'Franklin, VA' ,
2278 '51069' : 'Frederick, VA' ,
2279 '51071' : 'Giles, VA' ,
2280 '51077' : 'Grayson, VA' ,
2281 '51081' : 'Greensville, VA' ,
2282 '51083' : 'Halifax, VA' ,
2283 '51089' : 'Henry, VA' ,
2284 '51091' : 'Highland, VA' ,
2285 '51097' : 'King and Queen, VA' ,
2286 '51101' : 'King William, VA' ,
2287 '51103' : 'Lancaster, VA' ,
2288 '51105' : 'Lee, VA' ,
2289 '51109' : 'Louisa, VA' ,
2290 '51111' : 'Lunenburg, VA' ,
2291 '51113' : 'Madison, VA' ,
2292 '51117' : 'Mecklenburg, VA' ,
2293 '51119' : 'Middlesex, VA' ,
2294 '51121' : 'Montgomery, VA' ,
2295 '51125' : 'Nelson, VA' ,
2296 '51131' : 'Northampton, VA' ,
2297 '51133' : 'Northumberland, VA' ,
2298 '51135' : 'Nottoway, VA' ,
2299 '51137' : 'Orange, VA' ,
2300 '51139' : 'Page, VA' ,
2301 '51141' : 'Patrick, VA' ,
2302 '51147' : 'Prince Edward, VA' ,
2303 '51155' : 'Pulaski, VA' ,
2304 '51157' : 'Rappahannock, VA' ,
2305 '51159' : 'Richmond, VA' ,
2306 '51163' : 'Rockbridge, VA' ,
2307 '51165' : 'Rockingham, VA' ,
2308 '51167' : 'Russell, VA' ,
2309 '51171' : 'Shenandoah, VA' ,
2310 '51173' : 'Smyth, VA' ,
2311 '51175' : 'Southampton, VA' ,
2312 '51181' : 'Surry, VA' ,
2313 '51183' : 'Sussex, VA' ,
2314 '51185' : 'Tazewell, VA' ,
2315 '51193' : 'Westmoreland, VA' ,
2316 '51195' : 'Wise, VA' ,
2317 '51197' : 'Wythe, VA' ,
2318 '51530' : 'Buena Vista, VA' ,
2319 '51560' : 'Clifton Forge, VA' ,
2320 '51580' : 'Covington, VA' ,
2321 '51595' : 'Emporia, VA' ,
2322 '51620' : 'Franklin, VA' ,
2323 '51640' : 'Galax, VA' ,
2324 '51660' : 'Harrisonburg, VA' ,
2325 '51678' : 'Lexington, VA' ,
2326 '51690' : 'Martinsville, VA' ,
2327 '51720' : 'Norton, VA' ,
2328 '51750' : 'Radford, VA' ,
2329 '51780' : 'South Boston, VA' ,
2330 '51790' : 'Staunton, VA' ,
2331 '51820' : 'Waynesboro, VA' ,
2332 '51840' : 'Winchester, VA' ,
2333 '50000' : 'VERMONT' ,
2334 '50001' : 'Addison, VT' ,
2335 '50003' : 'Bennington, VT' ,
2336 '50005' : 'Caledonia, VT' ,
2337 '50009' : 'Essex, VT' ,
2338 '50015' : 'Lamoille, VT' ,
2339 '50017' : 'Orange, VT' ,
2340 '50019' : 'Orleans, VT' ,
2341 '50021' : 'Rutland, VT' ,
2342 '50023' : 'Washington, VT' ,
2343 '50025' : 'Windham, VT' ,
2344 '50027' : 'Windsor, VT' ,
2345 '53000' : 'WASHINGTON' ,
2346 '53001' : 'Adams, WA' ,
2347 '53003' : 'Asotin, WA' ,
2348 '53007' : 'Chelan, WA' ,
2349 '53009' : 'Clallam, WA' ,
2350 '53013' : 'Columbia, WA' ,
2351 '53015' : 'Cowlitz, WA' ,
2352 '53017' : 'Douglas, WA' ,
2353 '53019' : 'Ferry, WA' ,
2354 '53023' : 'Garfield, WA' ,
2355 '53025' : 'Grant, WA' ,
2356 '53027' : 'Grays Harbor, WA' ,
2357 '53031' : 'Jefferson, WA' ,
2358 '53037' : 'Kittitas, WA' ,
2359 '53039' : 'Klickitat, WA' ,
2360 '53041' : 'Lewis, WA' ,
2361 '53043' : 'Lincoln, WA' ,
2362 '53045' : 'Mason, WA' ,
2363 '53047' : 'Okanogan, WA' ,
2364 '53049' : 'Pacific, WA' ,
2365 '53051' : 'Pend Oreille, WA' ,
2366 '53055' : 'San Juan, WA' ,
2367 '53057' : 'Skagit, WA' ,
2368 '53059' : 'Skamania, WA' ,
2369 '53065' : 'Stevens, WA' ,
2370 '53069' : 'Wahkiakum, WA' ,
2371 '53071' : 'Walla Walla, WA' ,
2372 '53075' : 'Whitman, WA' ,
2373 '55000' : 'WISCONSIN' ,
2374 '55001' : 'Adams, WI' ,
2375 '55003' : 'Ashland, WI' ,
2376 '55005' : 'Barron, WI' ,
2377 '55007' : 'Bayfield, WI' ,
2378 '55011' : 'Buffalo, WI' ,
2379 '55013' : 'Burnett, WI' ,
2380 '55019' : 'Clark, WI' ,
2381 '55021' : 'Columbia, WI' ,
2382 '55023' : 'Crawford, WI' ,
2383 '55027' : 'Dodge, WI' ,
2384 '55029' : 'Door, WI' ,
2385 '55033' : 'Dunn, WI' ,
2386 '55037' : 'Florence, WI' ,
2387 '55039' : 'Fond du Lac, WI' ,
2388 '55041' : 'Forest, WI' ,
2389 '55043' : 'Grant, WI' ,
2390 '55045' : 'Green, WI' ,
2391 '55047' : 'Green Lake, WI' ,
2392 '55049' : 'Iowa, WI' ,
2393 '55051' : 'Iron, WI' ,
2394 '55053' : 'Jackson, WI' ,
2395 '55055' : 'Jefferson, WI' ,
2396 '55057' : 'Juneau, WI' ,
2397 '55061' : 'Kewaunee, WI' ,
2398 '55065' : 'Lafayette, WI' ,
2399 '55067' : 'Langlade, WI' ,
2400 '55069' : 'Lincoln, WI' ,
2401 '55071' : 'Manitowoc, WI' ,
2402 '55075' : 'Marinette, WI' ,
2403 '55077' : 'Marquette, WI' ,
2404 '55078' : 'Menominee, WI' ,
2405 '55081' : 'Monroe, WI' ,
2406 '55083' : 'Oconto, WI' ,
2407 '55085' : 'Oneida, WI' ,
2408 '55091' : 'Pepin, WI' ,
2409 '55095' : 'Polk, WI' ,
2410 '55097' : 'Portage, WI' ,
2411 '55099' : 'Price, WI' ,
2412 '55103' : 'Richland, WI' ,
2413 '55107' : 'Rusk, WI' ,
2414 '55111' : 'Sauk, WI' ,
2415 '55113' : 'Sawyer, WI' ,
2416 '55115' : 'Shawano, WI' ,
2417 '55119' : 'Taylor, WI' ,
2418 '55121' : 'Trempealeau, WI' ,
2419 '55123' : 'Vernon, WI' ,
2420 '55125' : 'Vilas, WI' ,
2421 '55127' : 'Walworth, WI' ,
2422 '55129' : 'Washburn, WI' ,
2423 '55135' : 'Waupaca, WI' ,
2424 '55137' : 'Waushara, WI' ,
2425 '55141' : 'Wood, WI' ,
2426 '54000' : 'WEST VIRGINIA' ,
2427 '54001' : 'Barbour, WV' ,
2428 '54005' : 'Boone, WV' ,
2429 '54007' : 'Braxton, WV' ,
2430 '54013' : 'Calhoun, WV' ,
2431 '54015' : 'Clay, WV' ,
2432 '54017' : 'Doddridge, WV' ,
2433 '54019' : 'Fayette, WV' ,
2434 '54021' : 'Gilmer, WV' ,
2435 '54023' : 'Grant, WV' ,
2436 '54025' : 'Greenbrier, WV' ,
2437 '54027' : 'Hampshire, WV' ,
2438 '54031' : 'Hardy, WV' ,
2439 '54033' : 'Harrison, WV' ,
2440 '54035' : 'Jackson, WV' ,
2441 '54041' : 'Lewis, WV' ,
2442 '54043' : 'Lincoln, WV' ,
2443 '54045' : 'Logan, WV' ,
2444 '54047' : 'McDowell, WV' ,
2445 '54049' : 'Marion, WV' ,
2446 '54053' : 'Mason, WV' ,
2447 '54055' : 'Mercer, WV' ,
2448 '54059' : 'Mingo, WV' ,
2449 '54061' : 'Monongalia, WV' ,
2450 '54063' : 'Monroe, WV' ,
2451 '54065' : 'Morgan, WV' ,
2452 '54067' : 'Nicholas, WV' ,
2453 '54071' : 'Pendleton, WV' ,
2454 '54073' : 'Pleasants, WV' ,
2455 '54075' : 'Pocahontas, WV' ,
2456 '54077' : 'Preston, WV' ,
2457 '54081' : 'Raleigh, WV' ,
2458 '54083' : 'Randolph, WV' ,
2459 '54085' : 'Ritchie, WV' ,
2460 '54087' : 'Roane, WV' ,
2461 '54089' : 'Summers, WV' ,
2462 '54091' : 'Taylor, WV' ,
2463 '54093' : 'Tucker, WV' ,
2464 '54095' : 'Tyler, WV' ,
2465 '54097' : 'Upshur, WV' ,
2466 '54101' : 'Webster, WV' ,
2467 '54103' : 'Wetzel, WV' ,
2468 '54105' : 'Wirt, WV' ,
2469 '54109' : 'Wyoming, WV' ,
2470 '56000' : 'WYOMING' ,
2471 '56001' : 'Albany, WY' ,
2472 '56003' : 'Big Horn, WY' ,
2473 '56005' : 'Campbell, WY' ,
2474 '56007' : 'Carbon, WY' ,
2475 '56009' : 'Converse, WY' ,
2476 '56011' : 'Crook, WY' ,
2477 '56013' : 'Fremont, WY' ,
2478 '56015' : 'Goshen, WY' ,
2479 '56017' : 'Hot Springs, WY' ,
2480 '56019' : 'Johnson, WY' ,
2481 '56023' : 'Lincoln, WY' ,
2482 '56027' : 'Niobrara, WY' ,
2483 '56029' : 'Park, WY' ,
2484 '56031' : 'Platte, WY' ,
2485 '56033' : 'Sheridan, WY' ,
2486 '56035' : 'Sublette, WY' ,
2487 '56037' : 'Sweetwater, WY' ,
2488 '56039' : 'Teton, WY' ,
2489 '56041' : 'Uinta, WY' ,
2490 '56043' : 'Washakie, WY' ,
2491 '56045' : 'Weston, WY' ,
2492 }
2493
2494 def fipsstate(fips,countyfp):
2495     tags = {}
2496
2497     if not fips:
2498         tags['is_in'] = 'USA'
2499         tags['is_in:country'] = 'USA'
2500         tags['is_in:country_code'] = 'US'
2501         return tags
2502
2503     if fips not in fipscodes:
2504         raise KeyError, 'missing FIPS code', fips
2505
2506     state, statecode, isocode = fipscodes[fips]
2507     county_fips_code = fips + "" + countyfp
2508     county = county_fips[county_fips_code]
2509     tags["tiger:county"] = county
2510     tags["is_in:county"] = county
2511
2512     tags["is_in"] =  'USA, '+state
2513     tags["is_in:state"] =  state
2514     tags["is_in:state_code"] = statecode
2515     tags["is_in:country_code"] = isocode
2516
2517     if isocode == 'US':
2518         tags["is_in:iso_3166_2"] =  isocode+':'+statecode
2519         tags["is_in:country"] = "USA"
2520
2521     else:
2522         # Reasonable to specify both here
2523         tags["is_in:country"] = 'USA;'+state
2524
2525     return tags
2526
2527 def parse_shp_for_osm( filename ):
2528     #ogr.RegisterAll()
2529
2530     dr = ogr.GetDriverByName("ESRI Shapefile")
2531     poDS = dr.Open( filename )
2532
2533     if poDS == None:
2534         raise "Open failed."
2535
2536     poLayer = poDS.GetLayer( 0 )
2537
2538     poLayer.ResetReading()
2539
2540     ret = []
2541
2542     poFeature = poLayer.GetNextFeature()
2543     while poFeature:
2544         tags = {}
2545         
2546         # WAY ID
2547         tags[iSource + ":way_id"] = int( poFeature.GetField("TLID") )
2548         
2549         # FEATURE IDENTIFICATION
2550         mtfcc = poFeature.GetField("MTFCC");
2551         if mtfcc != None:
2552
2553             if mtfcc == "L4010":        #Pipeline
2554                 tags["man_made"] = "pipeline"
2555             if mtfcc == "L4020":        #Powerline
2556                 tags["power"] = "line"
2557             if mtfcc == "L4031":        #Aerial Tramway/Ski Lift
2558                 tags["aerialway"] = "cable_car"
2559             if mtfcc == "L4110":        #Fence Line
2560                 tags["barrier"] = "fence"
2561             if mtfcc == "L4125":        #Cliff/Escarpment
2562                 tags["natural"] = "cliff"
2563             if mtfcc == "L4165":        #Ferry Crossing
2564                 tags["route"] = "ferry"
2565             if mtfcc == "R1011":        #Railroad Feature (Main, Spur, or Yard)
2566                 tags["railway"] = "rail"
2567                 ttyp = poFeature.GetField("TTYP")
2568                 if ttyp != None:
2569                     if ttyp == "S":
2570                         tags["service"] = "spur"
2571                     if ttyp == "Y":
2572                         tags["service"] = "yard"
2573                     tags["tiger:ttyp"] = ttyp
2574             if mtfcc == "R1051":        #Carline, Streetcar Track, Monorail, Other Mass Transit Rail)
2575                 tags["railway"] = "light_rail"
2576             if mtfcc == "R1052":        #Cog Rail Line, Incline Rail Line, Tram
2577                 tags["railway"] = "incline"
2578             if mtfcc == "S1100":
2579                 tags["highway"] = "primary"
2580             if mtfcc == "S1200":
2581                 tags["highway"] = "secondary"
2582             if mtfcc == "S1400":
2583                 tags["highway"] = "residential"
2584             if mtfcc == "S1500":
2585                 tags["highway"] = "track"
2586             if mtfcc == "S1630":        #Ramp
2587                 tags["highway"] = "motorway_link"
2588             if mtfcc == "S1640":        #Service Drive usually along a limited access highway
2589                 tags["highway"] = "service"
2590             if mtfcc == "S1710":        #Walkway/Pedestrian Trail
2591                 tags["highway"] = "path"
2592             if mtfcc == "S1720":
2593                 tags["highway"] = "steps"
2594             if mtfcc == "S1730":        #Alley
2595                 tags["highway"] = "service"
2596                 tags["service"] = "alley"
2597             if mtfcc == "S1740":        #Private Road for service vehicles (logging, oil, fields, ranches, etc.)
2598                 tags["highway"] = "service"
2599                 tags["access"] = "private"
2600             if mtfcc == "S1750":        #Private Driveway
2601                 tags["highway"] = "service"
2602                 tags["access"] = "private"
2603                 tags["service"] = "driveway"
2604             if mtfcc == "S1780":        #Parking Lot Road
2605                 tags["highway"] = "service"
2606                 tags["service"] = "parking_aisle"
2607             if mtfcc == "S1820":        #Bike Path or Trail
2608                 tags["highway"] = "cycleway"
2609             if mtfcc == "S1830":        #Bridle Path
2610                 tags["highway"] = "bridleway"
2611             tags["tiger:mtfcc"] = mtfcc
2612
2613         # FEATURE NAME
2614         if poFeature.GetField("FULLNAME"):
2615             #capitalizes the first letter of each word
2616             name = poFeature.GetField( "FULLNAME" )
2617             tags["name"] = name
2618
2619             #Attempt to guess highway grade
2620             if name[0:2] == "I-":
2621                 tags["highway"] = "motorway"
2622             if name[0:3] == "US ":
2623                 tags["highway"] = "primary"
2624             if name[0:3] == "US-":
2625                 tags["highway"] = "primary"
2626             if name[0:3] == "Hwy":
2627                 if tags["highway"] != "primary":
2628                     tags["highway"] = "secondary"
2629
2630         divroad = poFeature.GetField("DIVROAD")
2631         if divroad != None:
2632             if divroad == "Y" and tags["highway"] == "residential":
2633                 tags["highway"] = "tertiary"
2634             tags["tiger:separated"] = divroad
2635
2636         statefp = poFeature.GetField("STATEFP")
2637         countyfp = poFeature.GetField("COUNTYFP")
2638         if (statefp != None) and (countyfp != None):
2639            tags.update( fipsstate(statefp, countyfp) )
2640
2641         tlid = poFeature.GetField("TLID")
2642         if tlid != None:
2643             tags["tiger:tlid"] = tlid
2644
2645         lfromadd = poFeature.GetField("LFROMADD")
2646         if lfromadd != None:
2647             tags["tiger:lfromadd"] = lfromadd
2648
2649         rfromadd = poFeature.GetField("RFROMADD")
2650         if rfromadd != None:
2651             tags["tiger:rfromadd"] = rfromadd
2652
2653         ltoadd = poFeature.GetField("LTOADD")
2654         if ltoadd != None:
2655             tags["tiger:ltoadd"] = ltoadd
2656
2657         rtoadd = poFeature.GetField("RTOADD")
2658         if rtoadd != None:
2659             tags["tiger:rtoadd"] = rtoadd
2660
2661         zipl = poFeature.GetField("ZIPL")
2662         if zipl != None:
2663             tags["tiger:zip_left"] = zipl
2664
2665         zipr = poFeature.GetField("ZIPR")
2666         if zipr != None:
2667             tags["tiger:zip_right"] = zipr
2668
2669         if mtfcc not in ignoremtfcc:
2670             # COPY DOWN THE GEOMETRY
2671             geom = []
2672             
2673             rawgeom = poFeature.GetGeometryRef()
2674             for i in range( rawgeom.GetPointCount() ):
2675                 geom.append( (rawgeom.GetX(i), rawgeom.GetY(i)) )
2676     
2677             ret.append( (geom, tags) )
2678         poFeature = poLayer.GetNextFeature()
2679         
2680     return ret
2681
2682
2683 # ====================================
2684 # to do read .prj file for this data
2685 # Change the Projcs_wkt to match your datas prj file.
2686 # ====================================
2687 projcs_wkt = \
2688 """GEOGCS["GCS_North_American_1983",
2689         DATUM["D_North_American_1983",
2690         SPHEROID["GRS_1980",6378137,298.257222101]],
2691         PRIMEM["Greenwich",0],
2692         UNIT["Degree",0.017453292519943295]]"""
2693
2694 from_proj = osr.SpatialReference()
2695 from_proj.ImportFromWkt( projcs_wkt )
2696
2697 # output to WGS84
2698 to_proj = osr.SpatialReference()
2699 to_proj.SetWellKnownGeogCS( "EPSG:4326" )
2700
2701 tr = osr.CoordinateTransformation( from_proj, to_proj )
2702
2703 import math
2704 def length(segment, nodelist):
2705     '''Returns the length (in feet) of a segment'''
2706     first = True
2707     distance = 0
2708     lat_feet = 364613  #The approximate number of feet in one degree of latitude
2709     for point in segment:
2710         pointid, (lat, lon) = nodelist[ round_point( point ) ]
2711         if first:
2712             first = False
2713         else:
2714             #The approximate number of feet in one degree of longitute
2715             lrad = math.radians(lat)
2716             lon_feet = 365527.822 * math.cos(lrad) - 306.75853 * math.cos(3 * lrad) + 0.3937 * math.cos(5 * lrad)
2717             distance += math.sqrt(((lat - previous[0])*lat_feet)**2 + ((lon - previous[1])*lon_feet)**2)
2718         previous = (lat, lon)
2719     return distance
2720
2721 def addressways(waylist, nodelist, first_id):
2722     id = first_id
2723     awaylist = {}
2724     lat_feet = 364613  #The approximate number of feet in one degree of latitude
2725     distance = float(address_distance)
2726     ret = []
2727
2728     for waykey, segments in waylist.iteritems():
2729         waykey = dict(waykey)
2730         rsegments = []
2731         lsegments = []
2732         for segment in segments:
2733             lsegment = []
2734             rsegment = []
2735             lastpoint = None
2736
2737             #Don't pull back the ends of very short ways too much
2738             seglength = length(segment, nodelist)
2739             if seglength < float(address_pullback) * 3.0:
2740                 pullback = seglength / 3.0
2741             else:
2742                 pullback = float(address_pullback)
2743             if "tiger:lfromadd" in waykey:
2744                 lfromadd = waykey["tiger:lfromadd"]
2745             else:
2746                 lfromadd = None
2747             if "tiger:ltoadd" in waykey:
2748                 ltoadd = waykey["tiger:ltoadd"]
2749             else:
2750                 ltoadd = None
2751             if "tiger:rfromadd" in waykey:
2752                 rfromadd = waykey["tiger:rfromadd"]
2753             else: 
2754                 rfromadd = None
2755             if "tiger:rtoadd" in waykey:
2756                 rtoadd = waykey["tiger:rtoadd"]
2757             else:
2758                 rtoadd = None
2759             if rfromadd != None and rtoadd != None:
2760                 right = True
2761             else:
2762                 right = False
2763             if lfromadd != None and ltoadd != None:
2764                 left = True
2765             else:
2766                 left = False
2767             if left or right:
2768                 first = True
2769                 firstpointid, firstpoint = nodelist[ round_point( segment[0] ) ]
2770
2771                 finalpointid, finalpoint = nodelist[ round_point( segment[len(segment) - 1] ) ]
2772                 for point in segment:
2773                     pointid, (lat, lon) = nodelist[ round_point( point ) ]
2774
2775                     #The approximate number of feet in one degree of longitute
2776                     lrad = math.radians(lat)
2777                     lon_feet = 365527.822 * math.cos(lrad) - 306.75853 * math.cos(3 * lrad) + 0.3937 * math.cos(5 * lrad)
2778
2779 #Calculate the points of the offset ways
2780                     if lastpoint != None:
2781                         #Skip points too close to start
2782                         if math.sqrt((lat * lat_feet - firstpoint[0] * lat_feet)**2 + (lon * lon_feet - firstpoint[1] * lon_feet)**2) < pullback:
2783                             #Preserve very short ways (but will be rendered backwards)
2784                             if pointid != finalpointid:
2785                                 continue
2786                         #Skip points too close to end
2787                         if math.sqrt((lat * lat_feet - finalpoint[0] * lat_feet)**2 + (lon * lon_feet - finalpoint[1] * lon_feet)**2) < pullback:
2788                             #Preserve very short ways (but will be rendered backwards)
2789                             if (pointid != firstpointid) and (pointid != finalpointid):
2790                                 continue
2791
2792                         X = (lon - lastpoint[1]) * lon_feet
2793                         Y = (lat - lastpoint[0]) * lat_feet
2794                         if Y != 0:
2795                             theta = math.pi/2 - math.atan( X / Y)
2796                             Xp = math.sin(theta) * distance
2797                             Yp = math.cos(theta) * distance
2798                         else:
2799                             Xp = 0
2800                             if X > 0:
2801                                 Yp = -distance
2802                             else:
2803                                 Yp = distance
2804
2805                         if Y > 0:
2806                             Xp = -Xp
2807                         else:
2808                             Yp = -Yp
2809                                 
2810                         if first:
2811                             first = False
2812                             dX =  - (Yp * (pullback / distance)) / lon_feet #Pull back the first point
2813                             dY = (Xp * (pullback / distance)) / lat_feet
2814                             if left:
2815                                 lpoint = (lastpoint[0] + (Yp / lat_feet) - dY, lastpoint[1] + (Xp / lon_feet) - dX)
2816                                 lsegment.append( (id, lpoint) )
2817                                 id += 1
2818                             if right:
2819                                 rpoint = (lastpoint[0] - (Yp / lat_feet) - dY, lastpoint[1] - (Xp / lon_feet) - dX)
2820                                 rsegment.append( (id, rpoint) )
2821                                 id += 1
2822
2823                         else:
2824                             #round the curves
2825                             if delta[1] != 0:
2826                                 theta = abs(math.atan(delta[0] / delta[1]))
2827                             else:
2828                                 theta = math.pi / 2
2829                             if Xp != 0:
2830                                 theta = theta - abs(math.atan(Yp / Xp))
2831                             else: theta = theta - math.pi / 2
2832                             r = 1 + abs(math.tan(theta/2))
2833                             if left:
2834                                 lpoint = (lastpoint[0] + (Yp + delta[0]) * r / (lat_feet * 2), lastpoint[1] + (Xp + delta[1]) * r / (lon_feet * 2))
2835                                 lsegment.append( (id, lpoint) )
2836                                 id += 1
2837                             if right:
2838                                 rpoint = (lastpoint[0] - (Yp + delta[0]) * r / (lat_feet * 2), lastpoint[1] - (Xp + delta[1]) * r / (lon_feet * 2))
2839                                 
2840                                 rsegment.append( (id, rpoint) )
2841                                 id += 1
2842
2843                         delta = (Yp, Xp)
2844
2845                     lastpoint = (lat, lon)
2846
2847
2848 #Add in the last node
2849                 dX =  - (Yp * (pullback / distance)) / lon_feet
2850                 dY = (Xp * (pullback / distance)) / lat_feet
2851                 if left:
2852                     lpoint = (lastpoint[0] + (Yp + delta[0]) / (lat_feet * 2) + dY, lastpoint[1] + (Xp + delta[1]) / (lon_feet * 2) + dX )
2853                     lsegment.append( (id, lpoint) )
2854                     id += 1
2855                 if right:
2856                     rpoint = (lastpoint[0] - Yp / lat_feet + dY, lastpoint[1] - Xp / lon_feet + dX)
2857                     rsegment.append( (id, rpoint) )
2858                     id += 1
2859
2860 #Generate the tags for ways and nodes
2861                 rtags = []
2862                 ltags = []
2863                 tags = []
2864                 if "tiger:zip_right" in waykey:
2865                     zipr = waykey["tiger:zip_right"]
2866                     rtags.append( "<tag k=\"addr:postcode\" v=\"%s\" />" % zipr )
2867                 if "tiger:zip_left" in waykey:
2868                     zipl = waykey["tiger:zip_left"]
2869                     ltags.append( "<tag k=\"addr:postcode\" v=\"%s\" />" % zipl )
2870                 if "name" in waykey:
2871                     name = waykey["name"]
2872                     tags.append( "<tag k=\"addr:street\" v=\"%s\" />" % name )
2873                 if "is_in:state" in waykey:
2874                     state = waykey["is_in:state"]
2875                     tags.append( "<tag k=\"addr:state\" v=\"%s\" />" % state )
2876                 if "tiger:county" in waykey:
2877                     county = waykey["tiger:county"]
2878                     tags.append( "<tag k=\"addr:county\" v=\"%s\" />" % county )
2879                 if "is_in:country_code" in waykey:
2880                     country = waykey["is_in:country_code"]
2881                     tags.append( "<tag k=\"addr:country\" v=\"%s\" />" % country )
2882                 if "tiger:separated" in waykey:
2883                     separated = waykey["tiger:separated"]
2884                 else:
2885                     separated = "N"
2886                 ltags.extend(tags)
2887                 rtags.extend(tags)
2888
2889 #Write the nodes of the offset ways
2890                 if right:
2891                     rlinestring = [];
2892                     for i, point in rsegment:
2893                         rlinestring.append( "%f %f" % (point[0], point[1]) )
2894                 if left:
2895                     llinestring = [];
2896                     for i, point in lsegment:
2897                         llinestring.append( "%f %f" % (point[0], point[1]) )
2898                 if right:
2899                     rsegments.append( rsegment )
2900                 if left:
2901                     lsegments.append( lsegment )
2902                 rtofromint = right      #Do the addresses convert to integers?
2903                 ltofromint = left       #Do the addresses convert to integers?
2904                 if right:
2905                     try: rfromint = int(rfromadd)
2906                     except:
2907                         print("Non integer address: %s" % rfromadd)
2908                         rtofromint = False
2909                     try: rtoint = int(rtoadd)
2910                     except:
2911                         print("Non integer address: %s" % rtoadd)
2912                         rtofromint = False
2913                 if left:
2914                     try: lfromint = int(lfromadd)
2915                     except:
2916                         print("Non integer address: %s" % lfromadd)
2917                         ltofromint = False
2918                     try: ltoint = int(ltoadd)
2919                     except:
2920                         print("Non integer address: %s" % ltoadd)
2921                         ltofromint = False
2922                 import_guid = time.strftime( '%Y%m%d%H%M%S' )
2923                 if right:
2924                     id += 1
2925
2926                     interpolationtype = "";
2927                     if rtofromint:
2928                         if (rfromint % 2) == 0 and (rtoint % 2) == 0:
2929                             if separated == "Y":        #Doesn't matter if there is another side
2930         #                        ret.append( "<tag k=\"addr:interpolation\" v=\"even\" />" )
2931                                 interpolationtype = "even";
2932                             elif ltofromint and (lfromint % 2) == 1 and (ltoint % 2) == 1:
2933                                 interpolationtype = "even";
2934        #                         ret.append( "<tag k=\"addr:interpolation\" v=\"even\" />" )
2935                             else:
2936                                 interpolationtype = "all";
2937       #                          ret.append( "<tag k=\"addr:interpolation\" v=\"all\" />" )
2938                         elif (rfromint % 2) == 1 and (rtoint % 2) == 1:
2939                             if separated == "Y":        #Doesn't matter if there is another side
2940                                 interpolationtype = "odd";
2941      #                           ret.append( "<tag k=\"addr:interpolation\" v=\"odd\" />" )
2942                             elif ltofromint and (lfromint % 2) == 0 and (ltoint % 2) == 0:
2943                                 interpolationtype = "odd";
2944     #                            ret.append( "<tag k=\"addr:interpolation\" v=\"odd\" />" )
2945                             else:
2946                                 interpolationtype = "all";
2947    #                             ret.append( "<tag k=\"addr:interpolation\" v=\"all\" />" )
2948                         else:
2949                             interpolationtype = "all";
2950   #                          ret.append( "<tag k=\"addr:interpolation\" v=\"all\" />" )
2951                     else:
2952                         interpolationtype = "all";
2953  #                       ret.append( "<tag k=\"addr:interpolation\" v=\"all\" />" )
2954 #                   ret.extend(rtags)
2955   #                  ret.append( "<tag k=\"source\" v=\"%s_import_v%s_%s\" />" % (iSource, VERSION, import_guid) )
2956  #                   ret.append( "<tag k=\"attribution\" v=\"%s\" />" % (iAttrib) )
2957 #                    ret.append( "</way>" )
2958
2959                     ret.append( "select tigger_create_interpolation(ST_GeomFromText('LINESTRING(%s)',4326), '%s', '%s', '%s', '%s', '%s', '%s');" %
2960                                 ( ",".join(rlinestring), rfromadd, rtoadd, interpolationtype, name, county, zipr ) )
2961
2962                 if left:
2963                     id += 1
2964                     if ltofromint:
2965                         if (lfromint % 2) == 0 and (ltoint % 2) == 0:
2966                             if separated == "Y":
2967                                 interpolationtype = "even";
2968                             elif rtofromint and (rfromint % 2) == 1 and (rtoint % 2) == 1:
2969                                 interpolationtype = "even";
2970                             else:
2971                                 interpolationtype = "all";
2972
2973                         elif (lfromint % 2) == 1 and (ltoint % 2) == 1:
2974                             if separated == "Y":
2975                                 interpolationtype = "odd";
2976                             elif rtofromint and (rfromint %2 ) == 0 and (rtoint % 2) == 0:
2977                                 interpolationtype = "odd";
2978                             else:
2979                                 interpolationtype = "all";
2980                         else:
2981                             interpolationtype = "all";
2982                     else:
2983                         interpolationtype = "all";
2984                     ret.append( "select tigger_create_interpolation(ST_GeomFromText('LINESTRING(%s)',4326), '%s', '%s', '%s', '%s', '%s', '%s');" %
2985                                 ( ",".join(llinestring), lfromadd, ltoadd, interpolationtype, name, county, zipl ) )
2986
2987     return ret
2988
2989 def unproject( point ):
2990     pt = tr.TransformPoint( point[0], point[1] )
2991     return (pt[1], pt[0])
2992
2993 def round_point( point, accuracy=8 ):
2994     return tuple( [ round(x,accuracy) for x in point ] )
2995
2996 def compile_nodelist( parsed_gisdata, first_id=1 ):
2997     nodelist = {}
2998     
2999     i = first_id
3000     for geom, tags in parsed_gisdata:
3001         if len( geom )==0:
3002             continue
3003         
3004         for point in geom:
3005             r_point = round_point( point )
3006             if r_point not in nodelist:
3007                 nodelist[ r_point ] = (i, unproject( point ))
3008                 i += 1
3009             
3010     return (i, nodelist)
3011
3012 def adjacent( left, right ):
3013     left_left = round_point(left[0])
3014     left_right = round_point(left[-1])
3015     right_left = round_point(right[0])
3016     right_right = round_point(right[-1])
3017     
3018     return ( left_left == right_left or
3019              left_left == right_right or
3020              left_right == right_left or
3021              left_right == right_right )
3022              
3023 def glom( left, right ):
3024     
3025     left = list( left )
3026     right = list( right )
3027     
3028     left_left = round_point(left[0])
3029     left_right = round_point(left[-1])
3030     right_left = round_point(right[0])
3031     right_right = round_point(right[-1])
3032     
3033     if left_left == right_left:
3034         left.reverse()
3035         return left[0:-1] + right
3036         
3037     if left_left == right_right:
3038         return right[0:-1] + left
3039         
3040     if left_right == right_left:
3041         return left[0:-1] + right
3042         
3043     if left_right == right_right:
3044         right.reverse()
3045         return left[0:-1] + right
3046         
3047     raise 'segments are not adjacent'
3048
3049 def glom_once( segments ):
3050     if len(segments)==0:
3051         return segments
3052     
3053     unsorted = list( segments )
3054     x = unsorted.pop(0)
3055     
3056     while len( unsorted ) > 0:
3057         n = len( unsorted )
3058         
3059         for i in range(0, n):
3060             y = unsorted[i]
3061             if adjacent( x, y ):
3062                 y = unsorted.pop(i)
3063                 x = glom( x, y )
3064                 break
3065                 
3066         # Sorted and unsorted lists have no adjacent segments
3067         if len( unsorted ) == n:
3068             break
3069             
3070     return x, unsorted
3071     
3072 def glom_all( segments ):
3073     unsorted = segments
3074     chunks = []
3075     
3076     while unsorted != []:
3077         chunk, unsorted = glom_once( unsorted )
3078         chunks.append( chunk )
3079         
3080     return chunks
3081         
3082                 
3083
3084 def compile_waylist( parsed_gisdata, blank_way_id ):
3085     waylist = {}
3086     
3087     #Group by iSource:way_id
3088     for geom, tags in parsed_gisdata:
3089         way_key = tags.copy()
3090         way_key = ( way_key[iSource + ':way_id'], tuple( [(k,v) for k,v in way_key.iteritems()] ) )
3091         
3092         if way_key not in waylist:
3093             waylist[way_key] = []
3094             
3095         waylist[way_key].append( geom )
3096     
3097     ret = {}
3098     for (way_id, way_key), segments in waylist.iteritems():
3099         
3100         if way_id != blank_way_id:
3101             ret[way_key] = glom_all( segments )
3102         else:
3103             ret[way_key] = segments
3104         
3105     return ret
3106             
3107
3108 import time
3109 from xml.sax.saxutils import escape
3110 def shape_to_osm( shp_filename, base_filename, blank_way_id ):
3111     
3112     import_guid = time.strftime( '%Y%m%d%H%M%S' )
3113
3114     print "parsing shpfile"
3115     parsed_features = parse_shp_for_osm( shp_filename )
3116     
3117     print "compiling nodelist"
3118     i, nodelist = compile_nodelist( parsed_features )
3119     
3120     print "compiling waylist"
3121     waylist = compile_waylist( parsed_features, blank_way_id )
3122
3123     filenumber = 1
3124     objectcount = 0
3125     seen = {}
3126
3127     print "preparing address ways"
3128     ret = addressways(waylist, nodelist, i)
3129     osm_filename = "%s%d.osm" % (base_filename, filenumber)
3130     print "writing %s" %osm_filename
3131     fp = open( osm_filename, "w" )
3132     fp.write( "\n".join( ret ) )
3133     fp.close()
3134     filenumber += 1
3135
3136     
3137     print "constructing osm xml file"
3138     ret = []
3139     ret.append( "<?xml version='1.0' encoding='UTF-8'?>" )
3140     ret.append( "<osm version='0.6' generator='shape_to_osm.py'>" )
3141     
3142     for waykey, segments in waylist.iteritems():
3143         for segment in segments:
3144             #write the nodes
3145             for point in segment:
3146                 id, (lat, lon) = nodelist[ round_point( point ) ]
3147                 if id not in seen:
3148                     seen[id] = True
3149                     #write node
3150                     ret.append( "  <node id='-%d' action='create' visible='true' lat='%f' lon='%f' >" % (id, lat, lon) )
3151                     ret.append( "  </node>" )
3152                     objectcount += 1
3153                 else:
3154                     pass
3155                     #print "Skipping node %d" %id
3156
3157             #write the way
3158             ret.append( "  <way id='-%d' action='create' visible='true'>" % i )
3159             
3160             ids = [ nodelist[ round_point( point ) ][0] for point in segment ]
3161
3162             count = 0
3163             for id in ids:
3164                 count += 1
3165                 ret.append( "    <nd ref='-%d' />" % id )
3166                 if (count % Max_Waylength == 0) and (count != len(ids)):        #Split the way
3167                     for k, v in waykey:
3168                         ret.append( "    <tag k=\"%s\" v=\"%s\" />" % (k, escape(str(v))) )
3169                     ret.append( "    <tag k=\"source\" v=\"%s_import_v%s_%s\" />" % (iSource, VERSION, import_guid) )
3170                     ret.append( "    <tag k=\"attribution\" v=\"%s\" />" % (iAttrib) )
3171                 
3172                     ret.append( "  </way>" )
3173                     objectcount += 1
3174                     i += 1
3175                     ret.append( "  <way id='-%d' action='create' visible='true'>" % i )
3176                     ret.append( "    <nd ref='-%d' />" % id )
3177                 
3178             for k, v in waykey:
3179                 ret.append( "    <tag k=\"%s\" v=\"%s\" />" % (k, escape(str(v))) )
3180             ret.append( "    <tag k=\"source\" v=\"%s_import_v%s_%s\" />" % (iSource, VERSION, import_guid) )
3181             ret.append( "    <tag k=\"attribution\" v=\"%s\" />" % (iAttrib) )
3182                 
3183             ret.append( "  </way>" )
3184             objectcount += 1
3185             
3186             i += 1
3187
3188             if objectcount > maxNodes:  #Write a file
3189                 ret.append( "</osm>" )
3190                 osm_filename = "%s%d.osm" % (base_filename, filenumber)
3191                 print "writing %s" %osm_filename
3192                 fp = open( osm_filename, "w" )
3193                 fp.write( "\n".join( ret ) )
3194                 fp.close()
3195
3196                 objectcount = 0
3197                 filenumber += 1
3198                 seen = {}
3199                 ret = []
3200                 ret.append( "<?xml version='1.0' encoding='UTF-8'?>" )
3201                 ret.append( "<osm version='0.6' generator='shape_to_osm.py'>" )
3202         
3203     ret.append( "</osm>" )
3204     
3205     osm_filename = "%s%d.osm" % (base_filename, filenumber)
3206     print "writing %s" %osm_filename
3207     fp = open( osm_filename, "w" )
3208     fp.write( "\n".join( ret ) )
3209     fp.close()
3210     
3211 if __name__ == '__main__':
3212     import sys, os.path
3213     if len(sys.argv) < 2:
3214         print "%s filename.shp [filename.osm]" % sys.argv[0]
3215         sys.exit()
3216     shape = sys.argv[1]
3217     if len(sys.argv) > 2:
3218         osm = sys.argv[2]
3219     else:
3220         osm = shape[0:-4] + ".osm" 
3221     id = "1.shp"
3222         # Left over from massGIS unknown usage, but works fine hardcoded to "1.shp" which was the valu on a test of the actual mass data,
3223         #id = os.path.basename(shape).split("_")[-1]
3224     shape_to_osm( shape, osm, id )