interior 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +23 -89
- data/lib/interior/geocoder.rb +8 -0
- data/lib/interior/meridians.rb +72 -0
- data/lib/interior/version.rb +1 -1
- data/lib/interior.rb +1 -0
- data/spec/lib/interior/geocoder_spec.rb +30 -0
- metadata +5 -4
data/README.md
CHANGED
@@ -10,8 +10,8 @@ Interior uses the GeoCommunicator GeoCoder Web Service provided by the
|
|
10
10
|
[1]: http://www.geocommunicator.gov/GeoComm/lsis_home/townshipdecoder/index.htm "US Department of the Interior"
|
11
11
|
[2]: http://www.blm.gov/nils/GeoComm/documents/NILS_GeoCommunicator_Web_Services_TGC_Formats.pdf "Methods, Parameters, and Results PDF"
|
12
12
|
|
13
|
-
Usage
|
14
|
-
|
13
|
+
Usage: Get Latitude / Longitude
|
14
|
+
-------------------------------
|
15
15
|
Given township `1N`, range `1E`, section `35`, and meridian `14` (Gila-Salt Meridian
|
16
16
|
in the US Meridian table), we can get the center point latitude and longitude
|
17
17
|
in the state of Arizona with:
|
@@ -22,6 +22,8 @@ in the state of Arizona with:
|
|
22
22
|
response.latitude => 33.384549272498
|
23
23
|
response.longitude => -112.228362739723
|
24
24
|
|
25
|
+
![Usage Map 1](https://github.com/climate/interior/raw/master/maps/usage_map_01.png "Usage Map 1")
|
26
|
+
|
25
27
|
Section is option. If omitted, the centerpoint latitude and longitude will be for
|
26
28
|
the township and range:
|
27
29
|
|
@@ -31,6 +33,19 @@ the township and range:
|
|
31
33
|
response.latitude => 33.4211630233451
|
32
34
|
response.longitude => -112.254699834217
|
33
35
|
|
36
|
+
![Usage Map 2](https://github.com/climate/interior/raw/master/maps/usage_map_02.png "Usage Map 2")
|
37
|
+
|
38
|
+
Usage: Get Meridians
|
39
|
+
--------------------
|
40
|
+
For a collection of all meridians in Arizona:
|
41
|
+
|
42
|
+
require 'interior'
|
43
|
+
meridians = Interior::Geocoder.get_meridians('AZ')
|
44
|
+
meridians.inspect
|
45
|
+
=> [ { :name => 'Gila-Salt River', :id => 14 },
|
46
|
+
{ :name => 'Navajo', :id => 22 },
|
47
|
+
{ :name => 'San Bernardino', :id => 27 } ]
|
48
|
+
|
34
49
|
US Meridian Map
|
35
50
|
---------------
|
36
51
|
The US is divided into several meridians. A [larger map] [3] and table are available for reference.
|
@@ -39,7 +54,6 @@ The US is divided into several meridians. A [larger map] [3] and table are avail
|
|
39
54
|
|
40
55
|
[3]: https://github.com/climate/interior/raw/master/maps/meridians.jpg "Larger Map"
|
41
56
|
|
42
|
-
|
43
57
|
US Meridian Table
|
44
58
|
-----------------
|
45
59
|
Each meridian has a corresponding numeric key mapping:
|
@@ -49,13 +63,14 @@ Each meridian has a corresponding numeric key mapping:
|
|
49
63
|
<th>State</th>
|
50
64
|
<th>Meridian</th>
|
51
65
|
<th>Code</th>
|
66
|
+
<th>State</th>
|
67
|
+
<th>Meridian</th>
|
68
|
+
<th>Code</th>
|
52
69
|
</tr>
|
53
70
|
<tr>
|
54
71
|
<td>AL</td>
|
55
72
|
<td>HUNTSVILLE MER</td>
|
56
73
|
<td>16</td>
|
57
|
-
</tr>
|
58
|
-
<tr>
|
59
74
|
<td>AL</td>
|
60
75
|
<td>ST. STEPHENS MER</td>
|
61
76
|
<td>25</td>
|
@@ -64,8 +79,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
64
79
|
<td>AL</td>
|
65
80
|
<td>TALLAHASEE MER</td>
|
66
81
|
<td>29</td>
|
67
|
-
</tr>
|
68
|
-
<tr>
|
69
82
|
<td>AR</td>
|
70
83
|
<td>5TH PM</td>
|
71
84
|
<td>05</td>
|
@@ -74,8 +87,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
74
87
|
<td>AZ</td>
|
75
88
|
<td>GILA-SALT RIVER MER</td>
|
76
89
|
<td>14</td>
|
77
|
-
</tr>
|
78
|
-
<tr>
|
79
90
|
<td>AZ</td>
|
80
91
|
<td>NAVAJO MER</td>
|
81
92
|
<td>22</td>
|
@@ -84,8 +95,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
84
95
|
<td>AZ</td>
|
85
96
|
<td>SAN BERNARDINO MER</td>
|
86
97
|
<td>27</td>
|
87
|
-
</tr>
|
88
|
-
<tr>
|
89
98
|
<td>CA</td>
|
90
99
|
<td>GILA-SALT RIVER MER</td>
|
91
100
|
<td>14</td>
|
@@ -94,8 +103,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
94
103
|
<td>CA</td>
|
95
104
|
<td>HUMBOLDT MER</td>
|
96
105
|
<td>15</td>
|
97
|
-
</tr>
|
98
|
-
<tr>
|
99
106
|
<td>CA</td>
|
100
107
|
<td>MOUNT DIABLO MER</td>
|
101
108
|
<td>21</td>
|
@@ -104,8 +111,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
104
111
|
<td>CA</td>
|
105
112
|
<td>SAN BERNARDINO MER</td>
|
106
113
|
<td>27</td>
|
107
|
-
</tr>
|
108
|
-
<tr>
|
109
114
|
<td>CO</td>
|
110
115
|
<td>6TH PM</td>
|
111
116
|
<td>06</td>
|
@@ -114,8 +119,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
114
119
|
<td>CO</td>
|
115
120
|
<td>NEW MEX PM</td>
|
116
121
|
<td>23</td>
|
117
|
-
</tr>
|
118
|
-
<tr>
|
119
122
|
<td>CO</td>
|
120
123
|
<td>UTE MER</td>
|
121
124
|
<td>31</td>
|
@@ -124,8 +127,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
124
127
|
<td>CT</td>
|
125
128
|
<td>CONNECTICUT</td>
|
126
129
|
<td>CT</td>
|
127
|
-
</tr>
|
128
|
-
<tr>
|
129
130
|
<td>DE</td>
|
130
131
|
<td>DELAWARE</td>
|
131
132
|
<td>DE</td>
|
@@ -134,8 +135,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
134
135
|
<td>FL</td>
|
135
136
|
<td>TALLAHASEE MER</td>
|
136
137
|
<td>29</td>
|
137
|
-
</tr>
|
138
|
-
<tr>
|
139
138
|
<td>GA</td>
|
140
139
|
<td>GEORGIA</td>
|
141
140
|
<td>GA</td>
|
@@ -144,8 +143,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
144
143
|
<td>IA</td>
|
145
144
|
<td>5TH PM</td>
|
146
145
|
<td>05</td>
|
147
|
-
</tr>
|
148
|
-
<tr>
|
149
146
|
<td>ID</td>
|
150
147
|
<td>BOISE MER</td>
|
151
148
|
<td>08</td>
|
@@ -154,8 +151,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
154
151
|
<td>IL</td>
|
155
152
|
<td>2ND PM</td>
|
156
153
|
<td>02</td>
|
157
|
-
</tr>
|
158
|
-
<tr>
|
159
154
|
<td>IL</td>
|
160
155
|
<td>3RD PM</td>
|
161
156
|
<td>03</td>
|
@@ -164,8 +159,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
164
159
|
<td>IL</td>
|
165
160
|
<td>4TH PM ILLINOIS</td>
|
166
161
|
<td>04</td>
|
167
|
-
</tr>
|
168
|
-
<tr>
|
169
162
|
<td>IN</td>
|
170
163
|
<td>1ST PM</td>
|
171
164
|
<td>01</td>
|
@@ -174,8 +167,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
174
167
|
<td>IN</td>
|
175
168
|
<td>2ND PM</td>
|
176
169
|
<td>02</td>
|
177
|
-
</tr>
|
178
|
-
<tr>
|
179
170
|
<td>KS</td>
|
180
171
|
<td>6TH PM</td>
|
181
172
|
<td>06</td>
|
@@ -184,8 +175,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
184
175
|
<td>KY</td>
|
185
176
|
<td>KENTUCKY</td>
|
186
177
|
<td>KY</td>
|
187
|
-
</tr>
|
188
|
-
<tr>
|
189
178
|
<td>LA</td>
|
190
179
|
<td>LOUISIANA MER</td>
|
191
180
|
<td>18</td>
|
@@ -194,8 +183,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
194
183
|
<td>LA</td>
|
195
184
|
<td>ST. HELENA MER</td>
|
196
185
|
<td>24</td>
|
197
|
-
</tr>
|
198
|
-
<tr>
|
199
186
|
<td>MA</td>
|
200
187
|
<td>MASSACHUSETS</td>
|
201
188
|
<td>MA</td>
|
@@ -204,8 +191,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
204
191
|
<td>MD</td>
|
205
192
|
<td>MARYLAND</td>
|
206
193
|
<td>MD</td>
|
207
|
-
</tr>
|
208
|
-
<tr>
|
209
194
|
<td>ME</td>
|
210
195
|
<td>MAINE</td>
|
211
196
|
<td>ME</td>
|
@@ -214,8 +199,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
214
199
|
<td>MI</td>
|
215
200
|
<td>MICHIGAN MER</td>
|
216
201
|
<td>19</td>
|
217
|
-
</tr>
|
218
|
-
<tr>
|
219
202
|
<td>MN</td>
|
220
203
|
<td>5TH PM</td>
|
221
204
|
<td>05</td>
|
@@ -224,8 +207,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
224
207
|
<td>MN</td>
|
225
208
|
<td>4TH PM MN-WI</td>
|
226
209
|
<td>46</td>
|
227
|
-
</tr>
|
228
|
-
<tr>
|
229
210
|
<td>MO</td>
|
230
211
|
<td>5TH PM</td>
|
231
212
|
<td>05</td>
|
@@ -234,8 +215,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
234
215
|
<td>MS</td>
|
235
216
|
<td>CHICKASAW MER</td>
|
236
217
|
<td>09</td>
|
237
|
-
</tr>
|
238
|
-
<tr>
|
239
218
|
<td>MS</td>
|
240
219
|
<td>CHOCTAW MER</td>
|
241
220
|
<td>10</td>
|
@@ -244,8 +223,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
244
223
|
<td>MS</td>
|
245
224
|
<td>HUNTSVILLE MER</td>
|
246
225
|
<td>16</td>
|
247
|
-
</tr>
|
248
|
-
<tr>
|
249
226
|
<td>MS</td>
|
250
227
|
<td>ST. STEPHENS MER</td>
|
251
228
|
<td>25</td>
|
@@ -254,8 +231,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
254
231
|
<td>MS</td>
|
255
232
|
<td>WASHINGTON MER</td>
|
256
233
|
<td>32</td>
|
257
|
-
</tr>
|
258
|
-
<tr>
|
259
234
|
<td>MT</td>
|
260
235
|
<td>PRIN MER, MT</td>
|
261
236
|
<td>20</td>
|
@@ -264,8 +239,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
264
239
|
<td>NC</td>
|
265
240
|
<td>NO CAROLINA</td>
|
266
241
|
<td>NC</td>
|
267
|
-
</tr>
|
268
|
-
<tr>
|
269
242
|
<td>ND</td>
|
270
243
|
<td>5TH PM</td>
|
271
244
|
<td>05</td>
|
@@ -274,8 +247,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
274
247
|
<td>NE</td>
|
275
248
|
<td>6TH PM</td>
|
276
249
|
<td>06</td>
|
277
|
-
</tr>
|
278
|
-
<tr>
|
279
250
|
<td>NH</td>
|
280
251
|
<td>NEW HAMPSHIRE</td>
|
281
252
|
<td>NH</td>
|
@@ -284,8 +255,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
284
255
|
<td>NJ</td>
|
285
256
|
<td>NEW JERSEY</td>
|
286
257
|
<td>NJ</td>
|
287
|
-
</tr>
|
288
|
-
<tr>
|
289
258
|
<td>NM</td>
|
290
259
|
<td>NEW MEX PM</td>
|
291
260
|
<td>23</td>
|
@@ -294,8 +263,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
294
263
|
<td>NV</td>
|
295
264
|
<td>MOUNT DIABLO MER</td>
|
296
265
|
<td>21</td>
|
297
|
-
</tr>
|
298
|
-
<tr>
|
299
266
|
<td>NV</td>
|
300
267
|
<td>SAN BERNARDINO MER</td>
|
301
268
|
<td>27</td>
|
@@ -304,8 +271,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
304
271
|
<td>NY</td>
|
305
272
|
<td>NEW YORK</td>
|
306
273
|
<td>NY</td>
|
307
|
-
</tr>
|
308
|
-
<tr>
|
309
274
|
<td>OH</td>
|
310
275
|
<td>1ST PM</td>
|
311
276
|
<td>01</td>
|
@@ -314,8 +279,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
314
279
|
<td>OH</td>
|
315
280
|
<td>MICHIGAN MER</td>
|
316
281
|
<td>19</td>
|
317
|
-
</tr>
|
318
|
-
<tr>
|
319
282
|
<td>OH</td>
|
320
283
|
<td>OHIO RIVER SURVEY</td>
|
321
284
|
<td>35</td>
|
@@ -324,8 +287,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
324
287
|
<td>OH</td>
|
325
288
|
<td>BETWEEN THE MIAMIS</td>
|
326
289
|
<td>36</td>
|
327
|
-
</tr>
|
328
|
-
<tr>
|
329
290
|
<td>OH</td>
|
330
291
|
<td>MUSKINGUM RIVER BASIN</td>
|
331
292
|
<td>37</td>
|
@@ -334,8 +295,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
334
295
|
<td>OH</td>
|
335
296
|
<td>OHIO RIVER BASIN</td>
|
336
297
|
<td>38</td>
|
337
|
-
</tr>
|
338
|
-
<tr>
|
339
298
|
<td>OH</td>
|
340
299
|
<td>1ST SCIOTO RIVER BASE</td>
|
341
300
|
<td>39</td>
|
@@ -344,8 +303,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
344
303
|
<td>OH</td>
|
345
304
|
<td>2ND SCIOTO RIVER BASE</td>
|
346
305
|
<td>40</td>
|
347
|
-
</tr>
|
348
|
-
<tr>
|
349
306
|
<td>OH</td>
|
350
307
|
<td>3RD SCIOTO RIVER BASE</td>
|
351
308
|
<td>41</td>
|
@@ -354,8 +311,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
354
311
|
<td>OH</td>
|
355
312
|
<td>TWELVE MILE SQUARE</td>
|
356
313
|
<td>43</td>
|
357
|
-
</tr>
|
358
|
-
<tr>
|
359
314
|
<td>OH</td>
|
360
315
|
<td>WEST OF GREAT MIAMI</td>
|
361
316
|
<td>47</td>
|
@@ -364,8 +319,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
364
319
|
<td>OH</td>
|
365
320
|
<td>US MILITARY SURVEY</td>
|
366
321
|
<td>48</td>
|
367
|
-
</tr>
|
368
|
-
<tr>
|
369
322
|
<td>OH</td>
|
370
323
|
<td>CT WEST RES-OHIO</td>
|
371
324
|
<td>91</td>
|
@@ -374,8 +327,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
374
327
|
<td>OH</td>
|
375
328
|
<td>OHIO CO PUR-OHIO</td>
|
376
329
|
<td>92</td>
|
377
|
-
</tr>
|
378
|
-
<tr>
|
379
330
|
<td>OH</td>
|
380
331
|
<td>VA MILITARY SURVEY-OHIO</td>
|
381
332
|
<td>93</td>
|
@@ -384,8 +335,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
384
335
|
<td>OH</td>
|
385
336
|
<td>OHIO</td>
|
386
337
|
<td>OH</td>
|
387
|
-
</tr>
|
388
|
-
<tr>
|
389
338
|
<td>OK</td>
|
390
339
|
<td>CIMARRON MER</td>
|
391
340
|
<td>11</td>
|
@@ -394,8 +343,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
394
343
|
<td>OK</td>
|
395
344
|
<td>INDIAN MER</td>
|
396
345
|
<td>17</td>
|
397
|
-
</tr>
|
398
|
-
<tr>
|
399
346
|
<td>OR</td>
|
400
347
|
<td>WILLAMETTE MER</td>
|
401
348
|
<td>33</td>
|
@@ -404,8 +351,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
404
351
|
<td>PA</td>
|
405
352
|
<td>PENNSYLVANIA</td>
|
406
353
|
<td>PA</td>
|
407
|
-
</tr>
|
408
|
-
<tr>
|
409
354
|
<td>RI</td>
|
410
355
|
<td>RHODE ISLAND</td>
|
411
356
|
<td>RI</td>
|
@@ -414,8 +359,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
414
359
|
<td>SC</td>
|
415
360
|
<td>SO CAROLINA</td>
|
416
361
|
<td>SC</td>
|
417
|
-
</tr>
|
418
|
-
<tr>
|
419
362
|
<td>SD</td>
|
420
363
|
<td>5TH PM</td>
|
421
364
|
<td>05</td>
|
@@ -424,8 +367,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
424
367
|
<td>SD</td>
|
425
368
|
<td>6TH PM</td>
|
426
369
|
<td>06</td>
|
427
|
-
</tr>
|
428
|
-
<tr>
|
429
370
|
<td>SD</td>
|
430
371
|
<td>BLACK HILLS MER</td>
|
431
372
|
<td>07</td>
|
@@ -434,8 +375,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
434
375
|
<td>TN</td>
|
435
376
|
<td>TENNESSEE</td>
|
436
377
|
<td>TN</td>
|
437
|
-
</tr>
|
438
|
-
<tr>
|
439
378
|
<td>TX</td>
|
440
379
|
<td>TEXAS</td>
|
441
380
|
<td>TX</td>
|
@@ -444,8 +383,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
444
383
|
<td>UT</td>
|
445
384
|
<td>SALT LAKE MER</td>
|
446
385
|
<td>26</td>
|
447
|
-
</tr>
|
448
|
-
<tr>
|
449
386
|
<td>UT</td>
|
450
387
|
<td>UINTAH SPEC MER</td>
|
451
388
|
<td>30</td>
|
@@ -454,8 +391,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
454
391
|
<td>VA</td>
|
455
392
|
<td>VIRGINIA</td>
|
456
393
|
<td>VA</td>
|
457
|
-
</tr>
|
458
|
-
<tr>
|
459
394
|
<td>VT</td>
|
460
395
|
<td>VERMONT</td>
|
461
396
|
<td>VT</td>
|
@@ -464,8 +399,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
464
399
|
<td>WA</td>
|
465
400
|
<td>WILLAMETTE MER</td>
|
466
401
|
<td>33</td>
|
467
|
-
</tr>
|
468
|
-
<tr>
|
469
402
|
<td>WI</td>
|
470
403
|
<td>4TH PM MN-WI</td>
|
471
404
|
<td>46</td>
|
@@ -474,8 +407,6 @@ Each meridian has a corresponding numeric key mapping:
|
|
474
407
|
<td>WV</td>
|
475
408
|
<td>WEST VIRGINIA</td>
|
476
409
|
<td>WV</td>
|
477
|
-
</tr>
|
478
|
-
<tr>
|
479
410
|
<td>WY</td>
|
480
411
|
<td>6TH PM</td>
|
481
412
|
<td>06</td>
|
@@ -484,5 +415,8 @@ Each meridian has a corresponding numeric key mapping:
|
|
484
415
|
<td>WY</td>
|
485
416
|
<td>WIND RIVER MER</td>
|
486
417
|
<td>34</td>
|
418
|
+
<td></td>
|
419
|
+
<td></td>
|
420
|
+
<td></td>
|
487
421
|
</tr>
|
488
422
|
</table>
|
data/lib/interior/geocoder.rb
CHANGED
@@ -2,9 +2,12 @@ require 'net/http'
|
|
2
2
|
require 'cgi'
|
3
3
|
require 'nokogiri'
|
4
4
|
require 'interior/response'
|
5
|
+
require 'interior/meridians'
|
5
6
|
|
6
7
|
module Interior
|
7
8
|
class Geocoder
|
9
|
+
include Interior::Meridians
|
10
|
+
|
8
11
|
API_DOMAIN = 'www.geocommunicator.gov'
|
9
12
|
API_PATH = 'TownshipGeocoder/TownshipGeocoder.asmx/GetLatLon'
|
10
13
|
API_PARAM = 'TRS'
|
@@ -23,6 +26,11 @@ module Interior
|
|
23
26
|
result ? Interior::Response.new(result[:lat], result[:lon], true) : Interior::Response.new
|
24
27
|
end
|
25
28
|
|
29
|
+
# st : state
|
30
|
+
def self.get_meridians(st)
|
31
|
+
MERIDIANS[st]
|
32
|
+
end
|
33
|
+
|
26
34
|
private
|
27
35
|
|
28
36
|
def self.build_trs_param(st, me, to, to_dir, ra, ra_dir, se = nil)
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Interior
|
2
|
+
module Meridians
|
3
|
+
MERIDIANS = {
|
4
|
+
'AL' => [ { :id => 16, :name => 'Huntsville' },
|
5
|
+
{ :id => 25, :name => 'St. Stephens' },
|
6
|
+
{ :id => 29, :name => 'Tallahasee' } ],
|
7
|
+
'AR' => [ { :id => 5, :name => '5th' } ],
|
8
|
+
'AZ' => [ { :id => 14, :name => 'Gila-Salt River' },
|
9
|
+
{ :id => 22, :name => 'Navajo' },
|
10
|
+
{ :id => 27, :name => 'San Bernardino' } ],
|
11
|
+
'CA' => [ { :id => 14, :name => 'Gila-Salt River' },
|
12
|
+
{ :id => 15, :name => 'Humboldt' },
|
13
|
+
{ :id => 21, :name => 'Mount Diablo' },
|
14
|
+
{ :id => 27, :name => 'San Bernardino' } ],
|
15
|
+
'CO' => [ { :id => 6, :name => '6th' },
|
16
|
+
{ :id => 23, :name => 'New Mex' },
|
17
|
+
{ :id => 31, :name => 'Ute' } ],
|
18
|
+
'FL' => [ { :id => 29, :name => 'Tallahasee' } ],
|
19
|
+
'IA' => [ { :id => 5, :name => '5th' } ],
|
20
|
+
'ID' => [ { :id => 8, :name => 'Boise' } ],
|
21
|
+
'IL' => [ { :id => 2, :name => '2nd' },
|
22
|
+
{ :id => 3, :name => '3rd' },
|
23
|
+
{ :id => 4, :name => '4th Illinois' } ],
|
24
|
+
'IN' => [ { :id => 1, :name => '1st' },
|
25
|
+
{ :id => 2, :name => '2nd' } ],
|
26
|
+
'KS' => [ { :id => 6, :name => '6th' } ],
|
27
|
+
'LA' => [ { :id => 18, :name => 'Louisiana' },
|
28
|
+
{ :id => 24, :name => 'St. Helena' } ],
|
29
|
+
'MI' => [ { :id => 19, :name => 'Michigan' } ],
|
30
|
+
'MN' => [ { :id => 5, :name => '5th' },
|
31
|
+
{ :id => 46, :name => '4th' } ],
|
32
|
+
'MO' => [ { :id => 5, :name => '5th' } ],
|
33
|
+
'MS' => [ { :id => 9, :name => 'Chickasaw' },
|
34
|
+
{ :id => 10, :name => 'Choctaw' },
|
35
|
+
{ :id => 16, :name => 'Huntsville' },
|
36
|
+
{ :id => 25, :name => 'St. Stephens' },
|
37
|
+
{ :id => 32, :name => 'Washington' } ],
|
38
|
+
'MT' => [ { :id => 20, :name => 'Prin' } ],
|
39
|
+
'ND' => [ { :id => 5, :name => '5th' } ],
|
40
|
+
'NE' => [ { :id => 6, :name => '6th' } ],
|
41
|
+
'NM' => [ { :id => 23, :name => 'New Mex' } ],
|
42
|
+
'NV' => [ { :id => 21, :name => 'Mount Diablo' },
|
43
|
+
{ :id => 27, :name => 'San Bernardino' } ],
|
44
|
+
'OH' => [ { :id => 1, :name => '1st' },
|
45
|
+
{ :id => 19, :name => 'Michigan' },
|
46
|
+
{ :id => 35, :name => 'Ohio River Survey' },
|
47
|
+
{ :id => 36, :name => 'Between the Miamis' },
|
48
|
+
{ :id => 37, :name => 'Muskingum River Basin' },
|
49
|
+
{ :id => 38, :name => 'Ohio River Basin' },
|
50
|
+
{ :id => 39, :name => '1st Scioto River Base' },
|
51
|
+
{ :id => 40, :name => '2nd Scioto River Base' },
|
52
|
+
{ :id => 41, :name => '3rd Scioto River Base' },
|
53
|
+
{ :id => 43, :name => 'Twelve Mile Square' },
|
54
|
+
{ :id => 47, :name => 'West of Great Miami' },
|
55
|
+
{ :id => 48, :name => 'US Military Survey' },
|
56
|
+
{ :id => 91, :name => 'Ct West Res-Ohio' },
|
57
|
+
{ :id => 92, :name => 'Ohio Co Pur-Ohio' },
|
58
|
+
{ :id => 93, :name => 'Va Military Survey-ohio' } ],
|
59
|
+
'OK' => [ { :id => 11, :name => 'Cimarron' },
|
60
|
+
{ :id => 17, :name => 'Indian' } ],
|
61
|
+
'OR' => [ { :id => 33, :name => 'Willamette' } ],
|
62
|
+
'SD' => [ { :id => 5, :name => '5th' },
|
63
|
+
{ :id => 6, :name => '6th' },
|
64
|
+
{ :id => 7, :name => 'Black Hills' } ],
|
65
|
+
'UT' => [ { :id => 26, :name => 'Salt Lake' },
|
66
|
+
{ :id => 30, :name => 'Uintah Spec' } ],
|
67
|
+
'WA' => [ { :id => 33, :name => 'Willamette' } ],
|
68
|
+
'WI' => [ { :id => 46, :name => '4th' } ],
|
69
|
+
'WY' => [ { :id => 6, :name => '6th' },
|
70
|
+
{ :id => 34, :name => 'Wind River' } ] }
|
71
|
+
end
|
72
|
+
end
|
data/lib/interior/version.rb
CHANGED
data/lib/interior.rb
CHANGED
@@ -83,6 +83,36 @@ describe Interior::Geocoder do
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
+
describe '#get_meridians' do
|
87
|
+
subject { coder.get_meridians(st) }
|
88
|
+
|
89
|
+
it 'returns an array' do
|
90
|
+
subject.class.should == Array
|
91
|
+
end
|
92
|
+
|
93
|
+
context('when in Arizona') do
|
94
|
+
let(:st) { 'AZ' }
|
95
|
+
|
96
|
+
it 'returns the correct collection of meridians' do
|
97
|
+
subject.should == [
|
98
|
+
{ :name => "Gila-Salt River", :id => 14 },
|
99
|
+
{ :name => "Navajo", :id => 22 },
|
100
|
+
{ :name => "San Bernardino", :id => 27 } ]
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
context('when in Colorado') do
|
105
|
+
let(:st) { 'CO' }
|
106
|
+
|
107
|
+
it 'returns the correct collection of meridians' do
|
108
|
+
subject.should == [
|
109
|
+
{ :name => '6th', :id => 6 },
|
110
|
+
{ :name => 'New Mex', :id => 23 },
|
111
|
+
{ :name => 'Ute', :id => 31 } ]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
86
116
|
describe '#build_trs_param' do
|
87
117
|
subject { coder.send(:build_trs_param, st, me, to, to_dir, ra, ra_dir, se) }
|
88
118
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 9
|
9
|
+
- 0
|
10
|
+
version: 0.9.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Hunt
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- interior.gemspec
|
93
93
|
- lib/interior.rb
|
94
94
|
- lib/interior/geocoder.rb
|
95
|
+
- lib/interior/meridians.rb
|
95
96
|
- lib/interior/response.rb
|
96
97
|
- lib/interior/version.rb
|
97
98
|
- spec/fixtures/az.xml
|