my_society-map_it 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. data/Gemfile +3 -0
  2. data/README.md +7 -1
  3. data/Rakefile +10 -2
  4. data/lib/my_society/map_it.rb +93 -14
  5. data/lib/my_society/map_it/version.rb +1 -1
  6. data/my_society-map_it.gemspec +5 -0
  7. data/spec/cassettes/MySociety_MapIt_Postcode/gives_a_correct_gss_code_for_a_ward.yml +184 -0
  8. data/spec/cassettes/MySociety_MapIt_Postcode/gives_a_correct_lat/lng_for_a_postcode.yml +193 -0
  9. data/spec/cassettes/MySociety_MapIt_Postcode/gives_a_correct_ward.yml +184 -0
  10. data/spec/cassettes/MySociety_MapIt_Postcode/single_tier/correctly_identifies_a_single_tier_local_authority.yml +355 -0
  11. data/spec/cassettes/MySociety_MapIt_Postcode/single_tier/returns_the_correct_local_authority.yml +355 -0
  12. data/spec/cassettes/MySociety_MapIt_Postcode/single_tier/returns_the_correct_local_authority_gss_code.yml +355 -0
  13. data/spec/cassettes/MySociety_MapIt_Postcode/two_tier/correctly_identifies_a_two_tier_local_authority.yml +727 -0
  14. data/spec/cassettes/MySociety_MapIt_Postcode/two_tier/gives_a_correct_county_council.yml +365 -0
  15. data/spec/cassettes/MySociety_MapIt_Postcode/two_tier/gives_a_correct_county_council_gss_code.yml +365 -0
  16. data/spec/cassettes/MySociety_MapIt_Postcode/two_tier/gives_a_correct_district_council.yml +184 -0
  17. data/spec/cassettes/MySociety_MapIt_Postcode/two_tier/gives_a_correct_district_council_gss_code.yml +184 -0
  18. data/spec/cassettes/MySociety_MapIt_Postcode/two_tier/returns_a_hash_when_asked_for_a_local_authority.yml +727 -0
  19. data/spec/cassettes/MySociety_MapIt_Postcode/with_parish/returns_the_correct_parish.yml +184 -0
  20. data/spec/cassettes/MySociety_MapIt_Postcode/without_parish/returns_the_nil_for_a_parish.yml +179 -0
  21. data/spec/postcode_spec.rb +96 -0
  22. data/spec/spec_helper.rb +23 -0
  23. metadata +101 -5
@@ -0,0 +1,184 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://mapit.mysociety.org/postcode/B463LD
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ expires:
20
+ - Tue, 15 Oct 2013 13:20:51 GMT
21
+ vary:
22
+ - Cookie,Accept-Encoding
23
+ etag:
24
+ - ! '"40eca97e347e9ac2c1ce9caca6bfb5a2;gzip"'
25
+ cache-control:
26
+ - max-age=2419200
27
+ access-control-allow-origin:
28
+ - ! '*'
29
+ last-modified:
30
+ - Tue, 17 Sep 2013 13:20:51 GMT
31
+ content-type:
32
+ - application/json; charset=utf-8
33
+ x-url:
34
+ - /postcode/B463LD
35
+ transfer-encoding:
36
+ - chunked
37
+ date:
38
+ - Tue, 17 Sep 2013 14:44:15 GMT
39
+ age:
40
+ - '5004'
41
+ connection:
42
+ - keep-alive
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ! '{"wgs84_lat": 52.496789409955881, "coordsyst": "G", "shortcuts":
46
+ {"WMC": 66024, "ward": {"county": 15881, "district": 7606}, "council": {"county":
47
+ 2243, "district": 2458}}, "wgs84_lon": -1.706805276569471, "postcode": "B46
48
+ 3LD", "easting": 420002, "areas": {"40352": {"parent_area": null, "generation_high":
49
+ 20, "all_names": {}, "id": 40352, "codes": {"ons": "E02006473"}, "name": "North
50
+ Warwickshire 006", "country": "E", "type_name": "Middle Layer Super Output
51
+ Area (Full)", "generation_low": 13, "country_name": "England", "type": "OMF"},
52
+ "11809": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
53
+ 11809, "codes": {"ons": "05", "gss": "E15000005", "unit_id": "41426"}, "name":
54
+ "West Midlands", "country": "E", "type_name": "European region", "generation_low":
55
+ 1, "country_name": "England", "type": "EUR"}, "2243": {"parent_area": null,
56
+ "generation_high": 20, "all_names": {}, "id": 2243, "codes": {"ons": "44",
57
+ "gss": "E10000031", "unit_id": "10049"}, "name": "Warwickshire County Council",
58
+ "country": "E", "type_name": "County council", "generation_low": 1, "country_name":
59
+ "England", "type": "CTY"}, "900001": {"parent_area": null, "generation_high":
60
+ 20, "all_names": {}, "id": 900001, "codes": {}, "name": "European Parliament",
61
+ "country": "", "type_name": "European Parliament", "generation_low": 1, "country_name":
62
+ "-", "type": "EUP"}, "66024": {"parent_area": null, "generation_high": 20,
63
+ "all_names": {}, "id": 66024, "codes": {"gss": "E14000854", "unit_id": "24700"},
64
+ "name": "North Warwickshire", "country": "E", "type_name": "UK Parliament
65
+ constituency", "generation_low": 13, "country_name": "England", "type": "WMC"},
66
+ "15881": {"parent_area": 2243, "generation_high": 20, "all_names": {}, "id":
67
+ 15881, "codes": {"unit_id": "10112"}, "name": "Coleshill", "country": "E",
68
+ "type_name": "County council electoral division", "generation_low": 3, "country_name":
69
+ "England", "type": "CED"}, "97162": {"parent_area": null, "generation_high":
70
+ 20, "all_names": {}, "id": 97162, "codes": {"ons": "E01031021"}, "name": "North
71
+ Warwickshire 006C", "country": "E", "type_name": "Lower Layer Super Output
72
+ Area (Full)", "generation_low": 13, "country_name": "England", "type": "OLF"},
73
+ "131540": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
74
+ 131540, "codes": {"ons": "E01031021"}, "name": "North Warwickshire 006C",
75
+ "country": "E", "type_name": "Lower Layer Super Output Area (Generalised)",
76
+ "generation_low": 13, "country_name": "England", "type": "OLG"}, "7606": {"parent_area":
77
+ 2458, "generation_high": 20, "all_names": {}, "id": 7606, "codes": {"ons":
78
+ "44UBGC", "gss": "E05007463", "unit_id": "10113"}, "name": "Coleshill South",
79
+ "country": "E", "type_name": "District council ward", "generation_low": 1,
80
+ "country_name": "England", "type": "DIW"}, "55160": {"parent_area": 2458,
81
+ "generation_high": 20, "all_names": {}, "id": 55160, "codes": {"ons": "44UB010",
82
+ "gss": "E04009636", "unit_id": "10183"}, "name": "Coleshill", "country": "E",
83
+ "type_name": "Civil parish/community", "generation_low": 12, "country_name":
84
+ "England", "type": "CPC"}, "47546": {"parent_area": null, "generation_high":
85
+ 20, "all_names": {}, "id": 47546, "codes": {"ons": "E02006473"}, "name": "North
86
+ Warwickshire 006", "country": "E", "type_name": "Middle Layer Super Output
87
+ Area (Generalised)", "generation_low": 13, "country_name": "England", "type":
88
+ "OMG"}, "2458": {"parent_area": null, "generation_high": 20, "all_names":
89
+ {}, "id": 2458, "codes": {"ons": "44UB", "gss": "E07000218", "unit_id": "10124"},
90
+ "name": "North Warwickshire Borough Council", "country": "E", "type_name":
91
+ "District council", "generation_low": 1, "country_name": "England", "type":
92
+ "DIS"}, "900000": {"parent_area": null, "generation_high": 19, "all_names":
93
+ {}, "id": 900000, "codes": {}, "name": "House of Commons", "country": "",
94
+ "type_name": "UK Parliament", "generation_low": 1, "country_name": "-", "type":
95
+ "WMP"}}, "northing": 288805}'
96
+ http_version: '1.1'
97
+ recorded_at: Tue, 17 Sep 2013 14:44:15 GMT
98
+ - request:
99
+ method: get
100
+ uri: http://mapit.mysociety.org/point/4326/-1.706805276569471,52.49678940995588
101
+ body:
102
+ encoding: US-ASCII
103
+ string: ''
104
+ headers:
105
+ accept:
106
+ - ! '*/*'
107
+ user-agent:
108
+ - Ruby
109
+ response:
110
+ status:
111
+ code: 200
112
+ message: OK
113
+ headers:
114
+ expires:
115
+ - Tue, 15 Oct 2013 13:20:51 GMT
116
+ vary:
117
+ - Cookie,Accept-Encoding
118
+ etag:
119
+ - ! '"dd54c79a7ffa9ada97f196e2b607b2e1;gzip"'
120
+ cache-control:
121
+ - max-age=2419200
122
+ access-control-allow-origin:
123
+ - ! '*'
124
+ last-modified:
125
+ - Tue, 17 Sep 2013 13:20:51 GMT
126
+ content-type:
127
+ - application/json; charset=utf-8
128
+ x-url:
129
+ - /point/4326/-1.706805276569471,52.49678940995588
130
+ transfer-encoding:
131
+ - chunked
132
+ date:
133
+ - Tue, 17 Sep 2013 14:44:15 GMT
134
+ age:
135
+ - '5004'
136
+ connection:
137
+ - keep-alive
138
+ body:
139
+ encoding: US-ASCII
140
+ string: ! '{"40352": {"parent_area": null, "generation_high": 20, "all_names":
141
+ {}, "id": 40352, "codes": {"ons": "E02006473"}, "name": "North Warwickshire
142
+ 006", "country": "E", "type_name": "Middle Layer Super Output Area (Full)",
143
+ "generation_low": 13, "country_name": "England", "type": "OMF"}, "11809":
144
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 11809,
145
+ "codes": {"ons": "05", "gss": "E15000005", "unit_id": "41426"}, "name": "West
146
+ Midlands", "country": "E", "type_name": "European region", "generation_low":
147
+ 1, "country_name": "England", "type": "EUR"}, "2243": {"parent_area": null,
148
+ "generation_high": 20, "all_names": {}, "id": 2243, "codes": {"ons": "44",
149
+ "gss": "E10000031", "unit_id": "10049"}, "name": "Warwickshire County Council",
150
+ "country": "E", "type_name": "County council", "generation_low": 1, "country_name":
151
+ "England", "type": "CTY"}, "66024": {"parent_area": null, "generation_high":
152
+ 20, "all_names": {}, "id": 66024, "codes": {"gss": "E14000854", "unit_id":
153
+ "24700"}, "name": "North Warwickshire", "country": "E", "type_name": "UK Parliament
154
+ constituency", "generation_low": 13, "country_name": "England", "type": "WMC"},
155
+ "15881": {"parent_area": 2243, "generation_high": 20, "all_names": {}, "id":
156
+ 15881, "codes": {"unit_id": "10112"}, "name": "Coleshill", "country": "E",
157
+ "type_name": "County council electoral division", "generation_low": 3, "country_name":
158
+ "England", "type": "CED"}, "97162": {"parent_area": null, "generation_high":
159
+ 20, "all_names": {}, "id": 97162, "codes": {"ons": "E01031021"}, "name": "North
160
+ Warwickshire 006C", "country": "E", "type_name": "Lower Layer Super Output
161
+ Area (Full)", "generation_low": 13, "country_name": "England", "type": "OLF"},
162
+ "131540": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
163
+ 131540, "codes": {"ons": "E01031021"}, "name": "North Warwickshire 006C",
164
+ "country": "E", "type_name": "Lower Layer Super Output Area (Generalised)",
165
+ "generation_low": 13, "country_name": "England", "type": "OLG"}, "7606": {"parent_area":
166
+ 2458, "generation_high": 20, "all_names": {}, "id": 7606, "codes": {"ons":
167
+ "44UBGC", "gss": "E05007463", "unit_id": "10113"}, "name": "Coleshill South",
168
+ "country": "E", "type_name": "District council ward", "generation_low": 1,
169
+ "country_name": "England", "type": "DIW"}, "55160": {"parent_area": 2458,
170
+ "generation_high": 20, "all_names": {}, "id": 55160, "codes": {"ons": "44UB010",
171
+ "gss": "E04009636", "unit_id": "10183"}, "name": "Coleshill", "country": "E",
172
+ "type_name": "Civil parish/community", "generation_low": 12, "country_name":
173
+ "England", "type": "CPC"}, "47546": {"parent_area": null, "generation_high":
174
+ 20, "all_names": {}, "id": 47546, "codes": {"ons": "E02006473"}, "name": "North
175
+ Warwickshire 006", "country": "E", "type_name": "Middle Layer Super Output
176
+ Area (Generalised)", "generation_low": 13, "country_name": "England", "type":
177
+ "OMG"}, "2458": {"parent_area": null, "generation_high": 20, "all_names":
178
+ {}, "id": 2458, "codes": {"ons": "44UB", "gss": "E07000218", "unit_id": "10124"},
179
+ "name": "North Warwickshire Borough Council", "country": "E", "type_name":
180
+ "District council", "generation_low": 1, "country_name": "England", "type":
181
+ "DIS"}}'
182
+ http_version: '1.1'
183
+ recorded_at: Tue, 17 Sep 2013 14:44:15 GMT
184
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,355 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://mapit.mysociety.org/postcode/SW1A1AA
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ expires:
20
+ - Thu, 26 Sep 2013 12:29:30 GMT
21
+ vary:
22
+ - Cookie,Accept-Encoding
23
+ etag:
24
+ - ! '"2e5ca6db5b6ac0a3f008b0293a20a095;gzip"'
25
+ cache-control:
26
+ - max-age=2419200
27
+ access-control-allow-origin:
28
+ - ! '*'
29
+ last-modified:
30
+ - Thu, 29 Aug 2013 12:29:30 GMT
31
+ content-type:
32
+ - application/json; charset=utf-8
33
+ x-url:
34
+ - /postcode/SW1A1AA
35
+ transfer-encoding:
36
+ - chunked
37
+ date:
38
+ - Tue, 17 Sep 2013 14:44:16 GMT
39
+ age:
40
+ - '1649686'
41
+ connection:
42
+ - keep-alive
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ! '{"wgs84_lat": 51.501009611553926, "coordsyst": "G", "shortcuts":
46
+ {"WMC": 65759, "ward": 8569, "council": 2504}, "wgs84_lon": -0.14158706711000901,
47
+ "postcode": "SW1A 1AA", "easting": 529090, "areas": {"900000": {"parent_area":
48
+ null, "generation_high": 19, "all_names": {}, "id": 900000, "codes": {}, "name":
49
+ "House of Commons", "country": "", "type_name": "UK Parliament", "generation_low":
50
+ 1, "country_name": "-", "type": "WMP"}, "900001": {"parent_area": null, "generation_high":
51
+ 20, "all_names": {}, "id": 900001, "codes": {}, "name": "European Parliament",
52
+ "country": "", "type_name": "European Parliament", "generation_low": 1, "country_name":
53
+ "-", "type": "EUP"}, "42050": {"parent_area": null, "generation_high": 20,
54
+ "all_names": {}, "id": 42050, "codes": {"ons": "E02000977"}, "name": "Westminster
55
+ 018", "country": "E", "type_name": "Middle Layer Super Output Area (Generalised)",
56
+ "generation_low": 13, "country_name": "England", "type": "OMG"}, "900006":
57
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 900006,
58
+ "codes": {}, "name": "London Assembly", "country": "E", "type_name": "London
59
+ Assembly area", "generation_low": 1, "country_name": "England", "type": "LAS"},
60
+ "2247": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
61
+ 2247, "codes": {"unit_id": "41441"}, "name": "Greater London Authority", "country":
62
+ "E", "type_name": "Greater London Authority", "generation_low": 1, "country_name":
63
+ "England", "type": "GLA"}, "34856": {"parent_area": null, "generation_high":
64
+ 20, "all_names": {}, "id": 34856, "codes": {"ons": "E02000977"}, "name": "Westminster
65
+ 018", "country": "E", "type_name": "Middle Layer Super Output Area (Full)",
66
+ "generation_low": 13, "country_name": "England", "type": "OMF"}, "105255":
67
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 105255,
68
+ "codes": {"ons": "E01004736"}, "name": "Westminster 018C", "country": "E",
69
+ "type_name": "Lower Layer Super Output Area (Generalised)", "generation_low":
70
+ 13, "country_name": "England", "type": "OLG"}, "900002": {"parent_area": 900006,
71
+ "generation_high": 20, "all_names": {}, "id": 900002, "codes": {}, "name":
72
+ "London Assembly", "country": "E", "type_name": "London Assembly area (shared)",
73
+ "generation_low": 1, "country_name": "England", "type": "LAE"}, "2504": {"parent_area":
74
+ null, "generation_high": 20, "all_names": {}, "id": 2504, "codes": {"ons":
75
+ "00BK", "gss": "E09000033", "unit_id": "11164"}, "name": "Westminster City
76
+ Council", "country": "E", "type_name": "London borough", "generation_low":
77
+ 1, "country_name": "England", "type": "LBO"}, "11828": {"parent_area": 2247,
78
+ "generation_high": 20, "all_names": {}, "id": 11828, "codes": {"gss": "E32000014",
79
+ "unit_id": "41449"}, "name": "West Central", "country": "E", "type_name":
80
+ "London Assembly constituency", "generation_low": 1, "country_name": "England",
81
+ "type": "LAC"}, "8569": {"parent_area": 2504, "generation_high": 20, "all_names":
82
+ {}, "id": 8569, "codes": {"ons": "00BKGQ", "gss": "E05000644", "unit_id":
83
+ "11162"}, "name": "St James''s", "country": "E", "type_name": "London borough
84
+ ward", "generation_low": 1, "country_name": "England", "type": "LBW"}, "70877":
85
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 70877,
86
+ "codes": {"ons": "E01004736"}, "name": "Westminster 018C", "country": "E",
87
+ "type_name": "Lower Layer Super Output Area (Full)", "generation_low": 13,
88
+ "country_name": "England", "type": "OLF"}, "11806": {"parent_area": null,
89
+ "generation_high": 20, "all_names": {}, "id": 11806, "codes": {"ons": "07",
90
+ "gss": "E15000007", "unit_id": "41428"}, "name": "London", "country": "E",
91
+ "type_name": "European region", "generation_low": 1, "country_name": "England",
92
+ "type": "EUR"}, "65759": {"parent_area": null, "generation_high": 20, "all_names":
93
+ {}, "id": 65759, "codes": {"gss": "E14000639", "unit_id": "25040"}, "name":
94
+ "Cities of London and Westminster", "country": "E", "type_name": "UK Parliament
95
+ constituency", "generation_low": 13, "country_name": "England", "type": "WMC"}},
96
+ "northing": 179645}'
97
+ http_version: '1.1'
98
+ recorded_at: Tue, 17 Sep 2013 14:44:16 GMT
99
+ - request:
100
+ method: get
101
+ uri: http://mapit.mysociety.org/point/4326/-0.141587067110009,51.501009611553926
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ''
105
+ headers:
106
+ accept:
107
+ - ! '*/*'
108
+ user-agent:
109
+ - Ruby
110
+ response:
111
+ status:
112
+ code: 200
113
+ message: OK
114
+ headers:
115
+ expires:
116
+ - Tue, 15 Oct 2013 11:11:05 GMT
117
+ vary:
118
+ - Cookie,Accept-Encoding
119
+ etag:
120
+ - ! '"017a7a0a2be950c74ec3e27e78a9de30;gzip"'
121
+ cache-control:
122
+ - max-age=2419200
123
+ access-control-allow-origin:
124
+ - ! '*'
125
+ last-modified:
126
+ - Tue, 17 Sep 2013 11:11:05 GMT
127
+ content-type:
128
+ - application/json; charset=utf-8
129
+ x-url:
130
+ - /point/4326/-0.141587067110009,51.501009611553926
131
+ transfer-encoding:
132
+ - chunked
133
+ date:
134
+ - Tue, 17 Sep 2013 14:44:16 GMT
135
+ age:
136
+ - '12791'
137
+ connection:
138
+ - keep-alive
139
+ body:
140
+ encoding: US-ASCII
141
+ string: ! '{"42050": {"parent_area": null, "generation_high": 20, "all_names":
142
+ {}, "id": 42050, "codes": {"ons": "E02000977"}, "name": "Westminster 018",
143
+ "country": "E", "type_name": "Middle Layer Super Output Area (Generalised)",
144
+ "generation_low": 13, "country_name": "England", "type": "OMG"}, "2247": {"parent_area":
145
+ null, "generation_high": 20, "all_names": {}, "id": 2247, "codes": {"unit_id":
146
+ "41441"}, "name": "Greater London Authority", "country": "E", "type_name":
147
+ "Greater London Authority", "generation_low": 1, "country_name": "England",
148
+ "type": "GLA"}, "34856": {"parent_area": null, "generation_high": 20, "all_names":
149
+ {}, "id": 34856, "codes": {"ons": "E02000977"}, "name": "Westminster 018",
150
+ "country": "E", "type_name": "Middle Layer Super Output Area (Full)", "generation_low":
151
+ 13, "country_name": "England", "type": "OMF"}, "105255": {"parent_area": null,
152
+ "generation_high": 20, "all_names": {}, "id": 105255, "codes": {"ons": "E01004736"},
153
+ "name": "Westminster 018C", "country": "E", "type_name": "Lower Layer Super
154
+ Output Area (Generalised)", "generation_low": 13, "country_name": "England",
155
+ "type": "OLG"}, "2504": {"parent_area": null, "generation_high": 20, "all_names":
156
+ {}, "id": 2504, "codes": {"ons": "00BK", "gss": "E09000033", "unit_id": "11164"},
157
+ "name": "Westminster City Council", "country": "E", "type_name": "London borough",
158
+ "generation_low": 1, "country_name": "England", "type": "LBO"}, "11828": {"parent_area":
159
+ 2247, "generation_high": 20, "all_names": {}, "id": 11828, "codes": {"gss":
160
+ "E32000014", "unit_id": "41449"}, "name": "West Central", "country": "E",
161
+ "type_name": "London Assembly constituency", "generation_low": 1, "country_name":
162
+ "England", "type": "LAC"}, "8569": {"parent_area": 2504, "generation_high":
163
+ 20, "all_names": {}, "id": 8569, "codes": {"ons": "00BKGQ", "gss": "E05000644",
164
+ "unit_id": "11162"}, "name": "St James''s", "country": "E", "type_name": "London
165
+ borough ward", "generation_low": 1, "country_name": "England", "type": "LBW"},
166
+ "70877": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
167
+ 70877, "codes": {"ons": "E01004736"}, "name": "Westminster 018C", "country":
168
+ "E", "type_name": "Lower Layer Super Output Area (Full)", "generation_low":
169
+ 13, "country_name": "England", "type": "OLF"}, "11806": {"parent_area": null,
170
+ "generation_high": 20, "all_names": {}, "id": 11806, "codes": {"ons": "07",
171
+ "gss": "E15000007", "unit_id": "41428"}, "name": "London", "country": "E",
172
+ "type_name": "European region", "generation_low": 1, "country_name": "England",
173
+ "type": "EUR"}, "65759": {"parent_area": null, "generation_high": 20, "all_names":
174
+ {}, "id": 65759, "codes": {"gss": "E14000639", "unit_id": "25040"}, "name":
175
+ "Cities of London and Westminster", "country": "E", "type_name": "UK Parliament
176
+ constituency", "generation_low": 13, "country_name": "England", "type": "WMC"}}'
177
+ http_version: '1.1'
178
+ recorded_at: Tue, 17 Sep 2013 14:44:16 GMT
179
+ - request:
180
+ method: get
181
+ uri: http://mapit.mysociety.org/postcode/SW1A1AA
182
+ body:
183
+ encoding: US-ASCII
184
+ string: ''
185
+ headers:
186
+ accept:
187
+ - ! '*/*'
188
+ user-agent:
189
+ - Ruby
190
+ response:
191
+ status:
192
+ code: 200
193
+ message: OK
194
+ headers:
195
+ expires:
196
+ - Thu, 26 Sep 2013 12:29:30 GMT
197
+ vary:
198
+ - Cookie,Accept-Encoding
199
+ etag:
200
+ - ! '"2e5ca6db5b6ac0a3f008b0293a20a095;gzip"'
201
+ cache-control:
202
+ - max-age=2419200
203
+ access-control-allow-origin:
204
+ - ! '*'
205
+ last-modified:
206
+ - Thu, 29 Aug 2013 12:29:30 GMT
207
+ content-type:
208
+ - application/json; charset=utf-8
209
+ x-url:
210
+ - /postcode/SW1A1AA
211
+ transfer-encoding:
212
+ - chunked
213
+ date:
214
+ - Tue, 17 Sep 2013 14:44:16 GMT
215
+ age:
216
+ - '1649686'
217
+ connection:
218
+ - keep-alive
219
+ body:
220
+ encoding: US-ASCII
221
+ string: ! '{"wgs84_lat": 51.501009611553926, "coordsyst": "G", "shortcuts":
222
+ {"WMC": 65759, "ward": 8569, "council": 2504}, "wgs84_lon": -0.14158706711000901,
223
+ "postcode": "SW1A 1AA", "easting": 529090, "areas": {"900000": {"parent_area":
224
+ null, "generation_high": 19, "all_names": {}, "id": 900000, "codes": {}, "name":
225
+ "House of Commons", "country": "", "type_name": "UK Parliament", "generation_low":
226
+ 1, "country_name": "-", "type": "WMP"}, "900001": {"parent_area": null, "generation_high":
227
+ 20, "all_names": {}, "id": 900001, "codes": {}, "name": "European Parliament",
228
+ "country": "", "type_name": "European Parliament", "generation_low": 1, "country_name":
229
+ "-", "type": "EUP"}, "42050": {"parent_area": null, "generation_high": 20,
230
+ "all_names": {}, "id": 42050, "codes": {"ons": "E02000977"}, "name": "Westminster
231
+ 018", "country": "E", "type_name": "Middle Layer Super Output Area (Generalised)",
232
+ "generation_low": 13, "country_name": "England", "type": "OMG"}, "900006":
233
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 900006,
234
+ "codes": {}, "name": "London Assembly", "country": "E", "type_name": "London
235
+ Assembly area", "generation_low": 1, "country_name": "England", "type": "LAS"},
236
+ "2247": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
237
+ 2247, "codes": {"unit_id": "41441"}, "name": "Greater London Authority", "country":
238
+ "E", "type_name": "Greater London Authority", "generation_low": 1, "country_name":
239
+ "England", "type": "GLA"}, "34856": {"parent_area": null, "generation_high":
240
+ 20, "all_names": {}, "id": 34856, "codes": {"ons": "E02000977"}, "name": "Westminster
241
+ 018", "country": "E", "type_name": "Middle Layer Super Output Area (Full)",
242
+ "generation_low": 13, "country_name": "England", "type": "OMF"}, "105255":
243
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 105255,
244
+ "codes": {"ons": "E01004736"}, "name": "Westminster 018C", "country": "E",
245
+ "type_name": "Lower Layer Super Output Area (Generalised)", "generation_low":
246
+ 13, "country_name": "England", "type": "OLG"}, "900002": {"parent_area": 900006,
247
+ "generation_high": 20, "all_names": {}, "id": 900002, "codes": {}, "name":
248
+ "London Assembly", "country": "E", "type_name": "London Assembly area (shared)",
249
+ "generation_low": 1, "country_name": "England", "type": "LAE"}, "2504": {"parent_area":
250
+ null, "generation_high": 20, "all_names": {}, "id": 2504, "codes": {"ons":
251
+ "00BK", "gss": "E09000033", "unit_id": "11164"}, "name": "Westminster City
252
+ Council", "country": "E", "type_name": "London borough", "generation_low":
253
+ 1, "country_name": "England", "type": "LBO"}, "11828": {"parent_area": 2247,
254
+ "generation_high": 20, "all_names": {}, "id": 11828, "codes": {"gss": "E32000014",
255
+ "unit_id": "41449"}, "name": "West Central", "country": "E", "type_name":
256
+ "London Assembly constituency", "generation_low": 1, "country_name": "England",
257
+ "type": "LAC"}, "8569": {"parent_area": 2504, "generation_high": 20, "all_names":
258
+ {}, "id": 8569, "codes": {"ons": "00BKGQ", "gss": "E05000644", "unit_id":
259
+ "11162"}, "name": "St James''s", "country": "E", "type_name": "London borough
260
+ ward", "generation_low": 1, "country_name": "England", "type": "LBW"}, "70877":
261
+ {"parent_area": null, "generation_high": 20, "all_names": {}, "id": 70877,
262
+ "codes": {"ons": "E01004736"}, "name": "Westminster 018C", "country": "E",
263
+ "type_name": "Lower Layer Super Output Area (Full)", "generation_low": 13,
264
+ "country_name": "England", "type": "OLF"}, "11806": {"parent_area": null,
265
+ "generation_high": 20, "all_names": {}, "id": 11806, "codes": {"ons": "07",
266
+ "gss": "E15000007", "unit_id": "41428"}, "name": "London", "country": "E",
267
+ "type_name": "European region", "generation_low": 1, "country_name": "England",
268
+ "type": "EUR"}, "65759": {"parent_area": null, "generation_high": 20, "all_names":
269
+ {}, "id": 65759, "codes": {"gss": "E14000639", "unit_id": "25040"}, "name":
270
+ "Cities of London and Westminster", "country": "E", "type_name": "UK Parliament
271
+ constituency", "generation_low": 13, "country_name": "England", "type": "WMC"}},
272
+ "northing": 179645}'
273
+ http_version: '1.1'
274
+ recorded_at: Tue, 17 Sep 2013 14:44:16 GMT
275
+ - request:
276
+ method: get
277
+ uri: http://mapit.mysociety.org/point/4326/-0.141587067110009,51.501009611553926
278
+ body:
279
+ encoding: US-ASCII
280
+ string: ''
281
+ headers:
282
+ accept:
283
+ - ! '*/*'
284
+ user-agent:
285
+ - Ruby
286
+ response:
287
+ status:
288
+ code: 200
289
+ message: OK
290
+ headers:
291
+ expires:
292
+ - Tue, 15 Oct 2013 11:11:05 GMT
293
+ vary:
294
+ - Cookie,Accept-Encoding
295
+ etag:
296
+ - ! '"017a7a0a2be950c74ec3e27e78a9de30;gzip"'
297
+ cache-control:
298
+ - max-age=2419200
299
+ access-control-allow-origin:
300
+ - ! '*'
301
+ last-modified:
302
+ - Tue, 17 Sep 2013 11:11:05 GMT
303
+ content-type:
304
+ - application/json; charset=utf-8
305
+ x-url:
306
+ - /point/4326/-0.141587067110009,51.501009611553926
307
+ transfer-encoding:
308
+ - chunked
309
+ date:
310
+ - Tue, 17 Sep 2013 14:44:16 GMT
311
+ age:
312
+ - '12791'
313
+ connection:
314
+ - keep-alive
315
+ body:
316
+ encoding: US-ASCII
317
+ string: ! '{"42050": {"parent_area": null, "generation_high": 20, "all_names":
318
+ {}, "id": 42050, "codes": {"ons": "E02000977"}, "name": "Westminster 018",
319
+ "country": "E", "type_name": "Middle Layer Super Output Area (Generalised)",
320
+ "generation_low": 13, "country_name": "England", "type": "OMG"}, "2247": {"parent_area":
321
+ null, "generation_high": 20, "all_names": {}, "id": 2247, "codes": {"unit_id":
322
+ "41441"}, "name": "Greater London Authority", "country": "E", "type_name":
323
+ "Greater London Authority", "generation_low": 1, "country_name": "England",
324
+ "type": "GLA"}, "34856": {"parent_area": null, "generation_high": 20, "all_names":
325
+ {}, "id": 34856, "codes": {"ons": "E02000977"}, "name": "Westminster 018",
326
+ "country": "E", "type_name": "Middle Layer Super Output Area (Full)", "generation_low":
327
+ 13, "country_name": "England", "type": "OMF"}, "105255": {"parent_area": null,
328
+ "generation_high": 20, "all_names": {}, "id": 105255, "codes": {"ons": "E01004736"},
329
+ "name": "Westminster 018C", "country": "E", "type_name": "Lower Layer Super
330
+ Output Area (Generalised)", "generation_low": 13, "country_name": "England",
331
+ "type": "OLG"}, "2504": {"parent_area": null, "generation_high": 20, "all_names":
332
+ {}, "id": 2504, "codes": {"ons": "00BK", "gss": "E09000033", "unit_id": "11164"},
333
+ "name": "Westminster City Council", "country": "E", "type_name": "London borough",
334
+ "generation_low": 1, "country_name": "England", "type": "LBO"}, "11828": {"parent_area":
335
+ 2247, "generation_high": 20, "all_names": {}, "id": 11828, "codes": {"gss":
336
+ "E32000014", "unit_id": "41449"}, "name": "West Central", "country": "E",
337
+ "type_name": "London Assembly constituency", "generation_low": 1, "country_name":
338
+ "England", "type": "LAC"}, "8569": {"parent_area": 2504, "generation_high":
339
+ 20, "all_names": {}, "id": 8569, "codes": {"ons": "00BKGQ", "gss": "E05000644",
340
+ "unit_id": "11162"}, "name": "St James''s", "country": "E", "type_name": "London
341
+ borough ward", "generation_low": 1, "country_name": "England", "type": "LBW"},
342
+ "70877": {"parent_area": null, "generation_high": 20, "all_names": {}, "id":
343
+ 70877, "codes": {"ons": "E01004736"}, "name": "Westminster 018C", "country":
344
+ "E", "type_name": "Lower Layer Super Output Area (Full)", "generation_low":
345
+ 13, "country_name": "England", "type": "OLF"}, "11806": {"parent_area": null,
346
+ "generation_high": 20, "all_names": {}, "id": 11806, "codes": {"ons": "07",
347
+ "gss": "E15000007", "unit_id": "41428"}, "name": "London", "country": "E",
348
+ "type_name": "European region", "generation_low": 1, "country_name": "England",
349
+ "type": "EUR"}, "65759": {"parent_area": null, "generation_high": 20, "all_names":
350
+ {}, "id": 65759, "codes": {"gss": "E14000639", "unit_id": "25040"}, "name":
351
+ "Cities of London and Westminster", "country": "E", "type_name": "UK Parliament
352
+ constituency", "generation_low": 13, "country_name": "England", "type": "WMC"}}'
353
+ http_version: '1.1'
354
+ recorded_at: Tue, 17 Sep 2013 14:44:16 GMT
355
+ recorded_with: VCR 2.4.0