geocodio-ocd 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/geocodio/address.rb +114 -0
- data/lib/geocodio/address_set.rb +48 -0
- data/lib/geocodio/canadian/electoral_district_base.rb +21 -0
- data/lib/geocodio/canadian/electoral_districts.rb +23 -0
- data/lib/geocodio/canadian/federal_electoral_district.rb +12 -0
- data/lib/geocodio/canadian/provincial_electoral_district.rb +6 -0
- data/lib/geocodio/canadian.rb +14 -0
- data/lib/geocodio/client/error.rb +15 -0
- data/lib/geocodio/client/response.rb +13 -0
- data/lib/geocodio/client.rb +155 -0
- data/lib/geocodio/congressional_district.rb +30 -0
- data/lib/geocodio/legislator.rb +69 -0
- data/lib/geocodio/school_district.rb +15 -0
- data/lib/geocodio/state_legislative_district.rb +16 -0
- data/lib/geocodio/timezone.rb +16 -0
- data/lib/geocodio/utils.rb +43 -0
- data/lib/geocodio/version.rb +13 -0
- data/lib/geocodio.rb +9 -0
- data/spec/address_set_spec.rb +31 -0
- data/spec/address_spec.rb +235 -0
- data/spec/canadian_spec.rb +77 -0
- data/spec/client_spec.rb +196 -0
- data/spec/congressional_district_spec.rb +45 -0
- data/spec/legislator_spec.rb +116 -0
- data/spec/school_district_spec.rb +27 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/state_legislative_district_spec.rb +43 -0
- data/spec/timezone_spec.rb +23 -0
- data/spec/vcr_cassettes/alaska_geocode_with_fields.yml +68 -0
- data/spec/vcr_cassettes/batch_geocode.yml +83 -0
- data/spec/vcr_cassettes/batch_geocode_with_bad_address.yml +61 -0
- data/spec/vcr_cassettes/batch_geocode_with_fields.yml +121 -0
- data/spec/vcr_cassettes/batch_reverse.yml +181 -0
- data/spec/vcr_cassettes/batch_reverse_with_fields.yml +384 -0
- data/spec/vcr_cassettes/canadian.yml +101 -0
- data/spec/vcr_cassettes/geocode.yml +61 -0
- data/spec/vcr_cassettes/geocode_bad_address.yml +53 -0
- data/spec/vcr_cassettes/geocode_with_fields.yml +71 -0
- data/spec/vcr_cassettes/geocode_with_fields_legacy.yml +91 -0
- data/spec/vcr_cassettes/geocode_with_postdirectional.yml +61 -0
- data/spec/vcr_cassettes/invalid_key.yml +59 -0
- data/spec/vcr_cassettes/parse.yml +51 -0
- data/spec/vcr_cassettes/reverse.yml +97 -0
- data/spec/vcr_cassettes/reverse_with_fields.yml +163 -0
- data/spec/vcr_cassettes/reverse_with_fields_no_house_info.yml +138 -0
- metadata +189 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Geocodio::SchoolDistrict do
|
4
|
+
let(:geocodio) { Geocodio::Client.new }
|
5
|
+
|
6
|
+
subject(:district) do
|
7
|
+
VCR.use_cassette('geocode_with_fields') do
|
8
|
+
geocodio.geocode(['54 West Colorado Boulevard Pasadena CA 91105'], fields: %w[cd118 stateleg-next school timezone]).best.unified_school_district
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'has a name' do
|
13
|
+
expect(district.name).to eq('Pasadena Unified School District')
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'has a lea_code' do
|
17
|
+
expect(district.lea_code).to eq('0629940')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'has a grade_low' do
|
21
|
+
expect(district.grade_low).to eq('KG')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'has a grade_high' do
|
25
|
+
expect(district.grade_high).to eq('12')
|
26
|
+
end
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Measure test coverage.
|
2
|
+
require 'coveralls'
|
3
|
+
Coveralls.wear!
|
4
|
+
|
5
|
+
require 'geocodio'
|
6
|
+
require 'webmock/rspec'
|
7
|
+
require 'vcr'
|
8
|
+
|
9
|
+
ENV['GEOCODIO_API_KEY'] ||= 'secret_api_key'
|
10
|
+
|
11
|
+
VCR.configure do |c|
|
12
|
+
c.cassette_library_dir = 'spec/vcr_cassettes'
|
13
|
+
c.hook_into :webmock
|
14
|
+
c.filter_sensitive_data('secret_api_key') { ENV['GEOCODIO_API_KEY'] }
|
15
|
+
end
|
16
|
+
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# Run specs in random order to surface order dependencies. If you find an
|
19
|
+
# order dependency and want to debug it, you can fix the order by providing
|
20
|
+
# the seed, which is printed after each run.
|
21
|
+
# --seed 1234
|
22
|
+
config.order = 'random'
|
23
|
+
end
|
24
|
+
|
25
|
+
RSpec::Expectations.configuration.on_potential_false_positives = :nothing
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Geocodio::StateLegislativeDistrict do
|
4
|
+
let(:geocodio) { Geocodio::Client.new }
|
5
|
+
|
6
|
+
context 'typical numeric district' do
|
7
|
+
subject(:district) do
|
8
|
+
VCR.use_cassette('geocode_with_fields') do
|
9
|
+
geocodio.geocode(['54 West Colorado Boulevard Pasadena CA 91105'], fields: %w[cd118 stateleg-next school timezone])
|
10
|
+
.best
|
11
|
+
.house_districts
|
12
|
+
.first
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'has a name' do
|
17
|
+
expect(district.name).to eq("Assembly District 41")
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'has a district_number' do
|
21
|
+
expect(district.district_number).to eq(41)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'Alaska non-numeric state district' do
|
26
|
+
subject(:alaska_district) do
|
27
|
+
VCR.use_cassette('alaska_geocode_with_fields') do
|
28
|
+
geocodio.geocode(['4141 woronzof dr anchorage ak 99517'], fields: %w[cd stateleg])
|
29
|
+
.best
|
30
|
+
.senate_districts
|
31
|
+
.first
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'has a name' do
|
36
|
+
expect(alaska_district.name).to eq("State Senate District K")
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'has a district_number' do
|
40
|
+
expect(alaska_district.district_number).to eq('K')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Geocodio::Timezone do
|
4
|
+
let(:geocodio) { Geocodio::Client.new }
|
5
|
+
|
6
|
+
subject(:timezone) do
|
7
|
+
VCR.use_cassette('geocode_with_fields') do
|
8
|
+
geocodio.geocode(['54 West Colorado Boulevard Pasadena CA 91105'], fields: %w[cd118 stateleg-next school timezone]).best.timezone
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'has a name' do
|
13
|
+
expect(timezone.name).to eq('America/Los_Angeles')
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'has a utc_offset' do
|
17
|
+
expect(timezone.utc_offset).to eq(-8)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'observes DST' do
|
21
|
+
expect(timezone).to be_observes_dst
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.geocod.io/v1.7/geocode?api_key=secret_api_key&fields=cd,stateleg&q=4141%20woronzof%20dr%20anchorage%20ak%2099517
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- application/json
|
23
|
+
Transfer-Encoding:
|
24
|
+
- chunked
|
25
|
+
Cache-Control:
|
26
|
+
- no-cache, private
|
27
|
+
Date:
|
28
|
+
- Tue, 05 Jul 2022 22:21:48 GMT
|
29
|
+
X-Billable-Lookups-Count:
|
30
|
+
- '1'
|
31
|
+
X-Billable-Fields-Count:
|
32
|
+
- '2'
|
33
|
+
Access-Control-Allow-Origin:
|
34
|
+
- "*"
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, POST
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Content-Type, User-Agent
|
39
|
+
Access-Control-Expose-Headers:
|
40
|
+
- Request-Handler
|
41
|
+
Request-Handler:
|
42
|
+
- api245
|
43
|
+
Server:
|
44
|
+
- Unicorns with magic wands (https://www.geocod.io)
|
45
|
+
X-Request-Id:
|
46
|
+
- 6167D31F:FE04_05A15419:0050_62C4B97C_54777:3D82
|
47
|
+
Connection:
|
48
|
+
- close
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"input":{"address_components":{"number":"4141","street":"Woronzof","suffix":"Dr","formatted_street":"Woronzof
|
52
|
+
Dr","city":"Anchorage","state":"AK","zip":"99517","country":"US"},"formatted_address":"4141
|
53
|
+
Woronzof Dr, Anchorage, AK 99517"},"results":[{"address_components":{"number":"4141","street":"Woronzof","suffix":"Dr","formatted_street":"Woronzof
|
54
|
+
Dr","city":"Anchorage","county":"Anchorage Municipality","state":"AK","zip":"99517","country":"US"},"formatted_address":"4141
|
55
|
+
Woronzof Dr, Anchorage, AK 99517","location":{"lat":61.194138,"lng":-149.962696},"accuracy":1,"accuracy_type":"rooftop","source":"Anchorage","fields":{"congressional_districts":[{"name":"Congressional
|
56
|
+
District (at Large)","district_number":0,"ocd_id":null,"congress_number":"117th","congress_years":"2021-2023","proportion":1,"current_legislators":[{"type":"senator","bio":{"last_name":"Murkowski","first_name":"Lisa","birthday":"1957-05-22","gender":"F","party":"Republican"},"contact":{"url":"https:\/\/www.murkowski.senate.gov","address":"522
|
57
|
+
Hart Senate Office Building Washington DC 20510","phone":"202-224-6665","contact_form":"https:\/\/www.murkowski.senate.gov\/public\/index.cfm\/contact"},"social":{"rss_url":"http:\/\/www.murkowski.senate.gov\/public\/?a=rss.feed","twitter":"LisaMurkowski","facebook":"SenLisaMurkowski","youtube":"senatormurkowski","youtube_id":"UCaigku16AErqvD0wRuwGb9A"},"references":{"bioguide_id":"M001153","thomas_id":"01694","opensecrets_id":"N00026050","lis_id":"S288","cspan_id":"1004138","govtrack_id":"300075","votesmart_id":"15841","ballotpedia_id":"Lisa
|
58
|
+
Murkowski","washington_post_id":null,"icpsr_id":"40300","wikipedia_id":"Lisa
|
59
|
+
Murkowski"},"source":"Legislator data is originally collected and aggregated
|
60
|
+
by https:\/\/github.com\/unitedstates\/"},{"type":"senator","bio":{"last_name":"Sullivan","first_name":"Dan","birthday":"1964-11-13","gender":"M","party":"Republican"},"contact":{"url":"https:\/\/www.sullivan.senate.gov","address":"302
|
61
|
+
Hart Senate Office Building Washington DC 20510","phone":"202-224-3004","contact_form":"https:\/\/www.sullivan.senate.gov\/contact\/email"},"social":{"rss_url":null,"twitter":"SenDanSullivan","facebook":"SenDanSullivan","youtube":null,"youtube_id":"UC7tXCm8gKlAhTFo2kuf5ylw"},"references":{"bioguide_id":"S001198","thomas_id":"02290","opensecrets_id":"N00035774","lis_id":"S383","cspan_id":"1023262","govtrack_id":"412665","votesmart_id":"114964","ballotpedia_id":"Daniel
|
62
|
+
S. Sullivan","washington_post_id":null,"icpsr_id":"41500","wikipedia_id":"Dan
|
63
|
+
Sullivan (U.S. senator)"},"source":"Legislator data is originally collected
|
64
|
+
and aggregated by https:\/\/github.com\/unitedstates\/"}]}],"state_legislative_districts":{"house":[{"name":"State
|
65
|
+
House District 21","district_number":"21","ocd_id":null,"is_upcoming_state_legislative_district":false,"proportion":1}],"senate":[{"name":"State
|
66
|
+
Senate District K","district_number":"K","ocd_id":null,"is_upcoming_state_legislative_district":false,"proportion":1}]}}}]}'
|
67
|
+
recorded_at: Tue, 05 Jul 2022 22:21:48 GMT
|
68
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,83 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.geocod.io/v1.7/geocode?api_key=secret_api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '["1 Infinite Loop Cupertino CA 95014","54 West Colorado Boulevard Pasadena
|
9
|
+
CA 91105","826 Howard Street San Francisco CA 94103"]'
|
10
|
+
headers:
|
11
|
+
Accept:
|
12
|
+
- application/json
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
15
|
+
User-Agent:
|
16
|
+
- Ruby
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Content-Type:
|
25
|
+
- application/json
|
26
|
+
Transfer-Encoding:
|
27
|
+
- chunked
|
28
|
+
Cache-Control:
|
29
|
+
- no-cache, private
|
30
|
+
Date:
|
31
|
+
- Tue, 05 Jul 2022 22:21:42 GMT
|
32
|
+
X-Billable-Lookups-Count:
|
33
|
+
- '3'
|
34
|
+
X-Billable-Fields-Count:
|
35
|
+
- '0'
|
36
|
+
Access-Control-Allow-Origin:
|
37
|
+
- "*"
|
38
|
+
Access-Control-Allow-Methods:
|
39
|
+
- GET, POST
|
40
|
+
Access-Control-Allow-Headers:
|
41
|
+
- Content-Type, User-Agent
|
42
|
+
Access-Control-Expose-Headers:
|
43
|
+
- Request-Handler
|
44
|
+
Request-Handler:
|
45
|
+
- api228
|
46
|
+
Server:
|
47
|
+
- Unicorns with magic wands (https://www.geocod.io)
|
48
|
+
X-Request-Id:
|
49
|
+
- 6167D31F:FDF6_05A15419:0050_62C4B976_54147:3D82
|
50
|
+
Connection:
|
51
|
+
- close
|
52
|
+
body:
|
53
|
+
encoding: UTF-8
|
54
|
+
string: '{"results":[{"query":"1 Infinite Loop Cupertino CA 95014","response":{"input":{"address_components":{"number":"1","street":"Infinite","suffix":"Loop","formatted_street":"Infinite
|
55
|
+
Loop","city":"Cupertino","state":"CA","zip":"95014","country":"US"},"formatted_address":"1
|
56
|
+
Infinite Loop, Cupertino, CA 95014"},"results":[{"address_components":{"number":"1","street":"Infinite","suffix":"Loop","formatted_street":"Infinite
|
57
|
+
Loop","city":"Cupertino","county":"Santa Clara County","state":"CA","zip":"95014","country":"US"},"formatted_address":"1
|
58
|
+
Infinite Loop, Cupertino, CA 95014","location":{"lat":37.331524,"lng":-122.030231},"accuracy":1,"accuracy_type":"rooftop","source":"City
|
59
|
+
of Cupertino"}]}},{"query":"54 West Colorado Boulevard Pasadena CA 91105","response":{"input":{"address_components":{"number":"54","predirectional":"W","street":"Colorado","suffix":"Blvd","formatted_street":"W
|
60
|
+
Colorado Blvd","city":"Pasadena","state":"CA","zip":"91105","country":"US"},"formatted_address":"54
|
61
|
+
W Colorado Blvd, Pasadena, CA 91105"},"results":[{"address_components":{"number":"54","predirectional":"W","street":"Colorado","suffix":"Blvd","formatted_street":"W
|
62
|
+
Colorado Blvd","city":"Pasadena","county":"Los Angeles County","state":"CA","zip":"91105","country":"US"},"formatted_address":"54
|
63
|
+
W Colorado Blvd, Pasadena, CA 91105","location":{"lat":34.145375,"lng":-118.151622},"accuracy":1,"accuracy_type":"rooftop","source":"Los
|
64
|
+
Angeles"},{"address_components":{"number":"54","predirectional":"E","street":"Colorado","suffix":"Blvd","formatted_street":"E
|
65
|
+
Colorado Blvd","city":"Pasadena","county":"Los Angeles County","state":"CA","zip":"91105","country":"US"},"formatted_address":"54
|
66
|
+
E Colorado Blvd, Pasadena, CA 91105","location":{"lat":34.145499,"lng":-118.14932},"accuracy":0.8,"accuracy_type":"rooftop","source":"Los
|
67
|
+
Angeles"}]}},{"query":"826 Howard Street San Francisco CA 94103","response":{"input":{"address_components":{"number":"826","street":"Howard","suffix":"St","formatted_street":"Howard
|
68
|
+
St","city":"San Francisco","state":"CA","zip":"94103","country":"US"},"formatted_address":"826
|
69
|
+
Howard St, San Francisco, CA 94103"},"results":[{"address_components":{"number":"826","street":"Howard","suffix":"St","formatted_street":"Howard
|
70
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"826
|
71
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.782681,"lng":-122.40325},"accuracy":1,"accuracy_type":"range_interpolation","source":"TIGER\/Line\u00ae
|
72
|
+
dataset from the US Census Bureau"},{"address_components":{"number":"826","street":"Howard","suffix":"St","formatted_street":"Howard
|
73
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"826
|
74
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.782672,"lng":-122.403196},"accuracy":0.9,"accuracy_type":"range_interpolation","source":"TIGER\/Line\u00ae
|
75
|
+
dataset from the US Census Bureau"},{"address_components":{"number":"825","street":"Howard","suffix":"St","formatted_street":"Howard
|
76
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"825
|
77
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.782177,"lng":-122.402758},"accuracy":0.9,"accuracy_type":"nearest_rooftop_match","source":"San
|
78
|
+
Francisco"},{"address_components":{"number":"800","street":"Howard","suffix":"St","formatted_street":"Howard
|
79
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"800
|
80
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.783251,"lng":-122.403286},"accuracy":0.85,"accuracy_type":"nearest_rooftop_match","source":"San
|
81
|
+
Francisco"}]}}]}'
|
82
|
+
recorded_at: Tue, 05 Jul 2022 22:21:42 GMT
|
83
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.geocod.io/v1.7/geocode?api_key=secret_api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '["1 Infinite Loop Cupertino CA 95014"," , , "]'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Cache-Control:
|
28
|
+
- no-cache, private
|
29
|
+
Date:
|
30
|
+
- Tue, 05 Jul 2022 22:21:43 GMT
|
31
|
+
X-Billable-Lookups-Count:
|
32
|
+
- '1'
|
33
|
+
X-Billable-Fields-Count:
|
34
|
+
- '0'
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Methods:
|
38
|
+
- GET, POST
|
39
|
+
Access-Control-Allow-Headers:
|
40
|
+
- Content-Type, User-Agent
|
41
|
+
Access-Control-Expose-Headers:
|
42
|
+
- Request-Handler
|
43
|
+
Request-Handler:
|
44
|
+
- api245
|
45
|
+
Server:
|
46
|
+
- Unicorns with magic wands (https://www.geocod.io)
|
47
|
+
X-Request-Id:
|
48
|
+
- 6167D31F:FDFB_05A15419:0050_62C4B977_5423D:3D82
|
49
|
+
Connection:
|
50
|
+
- close
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"results":[{"query":"1 Infinite Loop Cupertino CA 95014","response":{"input":{"address_components":{"number":"1","street":"Infinite","suffix":"Loop","formatted_street":"Infinite
|
54
|
+
Loop","city":"Cupertino","state":"CA","zip":"95014","country":"US"},"formatted_address":"1
|
55
|
+
Infinite Loop, Cupertino, CA 95014"},"results":[{"address_components":{"number":"1","street":"Infinite","suffix":"Loop","formatted_street":"Infinite
|
56
|
+
Loop","city":"Cupertino","county":"Santa Clara County","state":"CA","zip":"95014","country":"US"},"formatted_address":"1
|
57
|
+
Infinite Loop, Cupertino, CA 95014","location":{"lat":37.331524,"lng":-122.030231},"accuracy":1,"accuracy_type":"rooftop","source":"City
|
58
|
+
of Cupertino"}]}},{"query":" , , ","response":{"error":"Could not geocode
|
59
|
+
address. Postal code or city required.","results":[]}}]}'
|
60
|
+
recorded_at: Tue, 05 Jul 2022 22:21:43 GMT
|
61
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,121 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.geocod.io/v1.7/geocode?api_key=secret_api_key&fields=cd118,stateleg-next,school,timezone
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '["1 Infinite Loop Cupertino CA 95014","54 West Colorado Boulevard Pasadena
|
9
|
+
CA 91105","826 Howard Street San Francisco CA 94103"]'
|
10
|
+
headers:
|
11
|
+
Accept:
|
12
|
+
- application/json
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
15
|
+
User-Agent:
|
16
|
+
- Ruby
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Content-Type:
|
25
|
+
- application/json
|
26
|
+
Transfer-Encoding:
|
27
|
+
- chunked
|
28
|
+
Cache-Control:
|
29
|
+
- no-cache, private
|
30
|
+
Date:
|
31
|
+
- Tue, 05 Jul 2022 22:21:44 GMT
|
32
|
+
X-Billable-Lookups-Count:
|
33
|
+
- '3'
|
34
|
+
X-Billable-Fields-Count:
|
35
|
+
- '12'
|
36
|
+
Access-Control-Allow-Origin:
|
37
|
+
- "*"
|
38
|
+
Access-Control-Allow-Methods:
|
39
|
+
- GET, POST
|
40
|
+
Access-Control-Allow-Headers:
|
41
|
+
- Content-Type, User-Agent
|
42
|
+
Access-Control-Expose-Headers:
|
43
|
+
- Request-Handler
|
44
|
+
Request-Handler:
|
45
|
+
- api245
|
46
|
+
Server:
|
47
|
+
- Unicorns with magic wands (https://www.geocod.io)
|
48
|
+
X-Request-Id:
|
49
|
+
- 6167D31F:FDFD_05A15419:0050_62C4B977_542CD:3D82
|
50
|
+
Connection:
|
51
|
+
- close
|
52
|
+
body:
|
53
|
+
encoding: UTF-8
|
54
|
+
string: '{"results":[{"query":"1 Infinite Loop Cupertino CA 95014","response":{"input":{"address_components":{"number":"1","street":"Infinite","suffix":"Loop","formatted_street":"Infinite
|
55
|
+
Loop","city":"Cupertino","state":"CA","zip":"95014","country":"US"},"formatted_address":"1
|
56
|
+
Infinite Loop, Cupertino, CA 95014"},"results":[{"address_components":{"number":"1","street":"Infinite","suffix":"Loop","formatted_street":"Infinite
|
57
|
+
Loop","city":"Cupertino","county":"Santa Clara County","state":"CA","zip":"95014","country":"US"},"formatted_address":"1
|
58
|
+
Infinite Loop, Cupertino, CA 95014","location":{"lat":37.331524,"lng":-122.030231},"accuracy":1,"accuracy_type":"rooftop","source":"City
|
59
|
+
of Cupertino","fields":{"congressional_districts":[{"name":"Congressional
|
60
|
+
District 17","district_number":17,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:17","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
61
|
+
District 26","district_number":"26","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:26","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
62
|
+
Senate District 13","district_number":"13","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:13","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"elementary":{"name":"Cupertino
|
63
|
+
Union Elementary School District","lea_code":"0610290","grade_low":"KG","grade_high":"08"},"secondary":{"name":"Fremont
|
64
|
+
Union High School District","lea_code":"0614430","grade_low":"09","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
65
|
+
OpenStreetMap contributors"}}}]}},{"query":"54 West Colorado Boulevard Pasadena
|
66
|
+
CA 91105","response":{"input":{"address_components":{"number":"54","predirectional":"W","street":"Colorado","suffix":"Blvd","formatted_street":"W
|
67
|
+
Colorado Blvd","city":"Pasadena","state":"CA","zip":"91105","country":"US"},"formatted_address":"54
|
68
|
+
W Colorado Blvd, Pasadena, CA 91105"},"results":[{"address_components":{"number":"54","predirectional":"W","street":"Colorado","suffix":"Blvd","formatted_street":"W
|
69
|
+
Colorado Blvd","city":"Pasadena","county":"Los Angeles County","state":"CA","zip":"91105","country":"US"},"formatted_address":"54
|
70
|
+
W Colorado Blvd, Pasadena, CA 91105","location":{"lat":34.145375,"lng":-118.151622},"accuracy":1,"accuracy_type":"rooftop","source":"Los
|
71
|
+
Angeles","fields":{"congressional_districts":[{"name":"Congressional District
|
72
|
+
28","district_number":28,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:28","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
73
|
+
District 41","district_number":"41","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:41","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
74
|
+
Senate District 25","district_number":"25","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:25","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"unified":{"name":"Pasadena
|
75
|
+
Unified School District","lea_code":"0629940","grade_low":"KG","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
76
|
+
OpenStreetMap contributors"}}},{"address_components":{"number":"54","predirectional":"E","street":"Colorado","suffix":"Blvd","formatted_street":"E
|
77
|
+
Colorado Blvd","city":"Pasadena","county":"Los Angeles County","state":"CA","zip":"91105","country":"US"},"formatted_address":"54
|
78
|
+
E Colorado Blvd, Pasadena, CA 91105","location":{"lat":34.145499,"lng":-118.14932},"accuracy":0.8,"accuracy_type":"rooftop","source":"Los
|
79
|
+
Angeles","fields":{"congressional_districts":[{"name":"Congressional District
|
80
|
+
28","district_number":28,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:28","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
81
|
+
District 41","district_number":"41","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:41","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
82
|
+
Senate District 25","district_number":"25","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:25","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"unified":{"name":"Pasadena
|
83
|
+
Unified School District","lea_code":"0629940","grade_low":"KG","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
84
|
+
OpenStreetMap contributors"}}}]}},{"query":"826 Howard Street San Francisco
|
85
|
+
CA 94103","response":{"input":{"address_components":{"number":"826","street":"Howard","suffix":"St","formatted_street":"Howard
|
86
|
+
St","city":"San Francisco","state":"CA","zip":"94103","country":"US"},"formatted_address":"826
|
87
|
+
Howard St, San Francisco, CA 94103"},"results":[{"address_components":{"number":"826","street":"Howard","suffix":"St","formatted_street":"Howard
|
88
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"826
|
89
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.782681,"lng":-122.40325},"accuracy":1,"accuracy_type":"range_interpolation","source":"TIGER\/Line\u00ae
|
90
|
+
dataset from the US Census Bureau","fields":{"congressional_districts":[{"name":"Congressional
|
91
|
+
District 11","district_number":11,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:11","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
92
|
+
District 17","district_number":"17","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:17","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
93
|
+
Senate District 11","district_number":"11","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:11","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"unified":{"name":"San
|
94
|
+
Francisco Unified School District","lea_code":"0634410","grade_low":"KG","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
95
|
+
OpenStreetMap contributors"}}},{"address_components":{"number":"826","street":"Howard","suffix":"St","formatted_street":"Howard
|
96
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"826
|
97
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.782672,"lng":-122.403196},"accuracy":0.9,"accuracy_type":"range_interpolation","source":"TIGER\/Line\u00ae
|
98
|
+
dataset from the US Census Bureau","fields":{"congressional_districts":[{"name":"Congressional
|
99
|
+
District 11","district_number":11,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:11","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
100
|
+
District 17","district_number":"17","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:17","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
101
|
+
Senate District 11","district_number":"11","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:11","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"unified":{"name":"San
|
102
|
+
Francisco Unified School District","lea_code":"0634410","grade_low":"KG","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
103
|
+
OpenStreetMap contributors"}}},{"address_components":{"number":"825","street":"Howard","suffix":"St","formatted_street":"Howard
|
104
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"825
|
105
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.782177,"lng":-122.402758},"accuracy":0.9,"accuracy_type":"nearest_rooftop_match","source":"San
|
106
|
+
Francisco","fields":{"congressional_districts":[{"name":"Congressional District
|
107
|
+
11","district_number":11,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:11","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
108
|
+
District 17","district_number":"17","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:17","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
109
|
+
Senate District 11","district_number":"11","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:11","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"unified":{"name":"San
|
110
|
+
Francisco Unified School District","lea_code":"0634410","grade_low":"KG","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
111
|
+
OpenStreetMap contributors"}}},{"address_components":{"number":"800","street":"Howard","suffix":"St","formatted_street":"Howard
|
112
|
+
St","city":"San Francisco","county":"San Francisco County","state":"CA","zip":"94103","country":"US"},"formatted_address":"800
|
113
|
+
Howard St, San Francisco, CA 94103","location":{"lat":37.783251,"lng":-122.403286},"accuracy":0.85,"accuracy_type":"nearest_rooftop_match","source":"San
|
114
|
+
Francisco","fields":{"congressional_districts":[{"name":"Congressional District
|
115
|
+
11","district_number":11,"ocd_id":"ocd-division\/country:us\/state:ca\/cd:11","congress_number":"118th","congress_years":"2023-2025","proportion":1}],"state_legislative_districts":{"house":[{"name":"Assembly
|
116
|
+
District 17","district_number":"17","ocd_id":"ocd-division\/country:us\/state:ca\/sldl:17","is_upcoming_state_legislative_district":true,"proportion":1}],"senate":[{"name":"State
|
117
|
+
Senate District 11","district_number":"11","ocd_id":"ocd-division\/country:us\/state:ca\/sldu:11","is_upcoming_state_legislative_district":true,"proportion":1}]},"school_districts":{"unified":{"name":"San
|
118
|
+
Francisco Unified School District","lea_code":"0634410","grade_low":"KG","grade_high":"12"}},"timezone":{"name":"America\/Los_Angeles","utc_offset":-8,"observes_dst":true,"abbreviation":"PST","source":"\u00a9
|
119
|
+
OpenStreetMap contributors"}}}]}}]}'
|
120
|
+
recorded_at: Tue, 05 Jul 2022 22:21:44 GMT
|
121
|
+
recorded_with: VCR 6.1.0
|