geocodio-gem 2.1.0 → 2.3.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +12 -8
- data/README.md +94 -53
- data/lib/geocodio/gem/version.rb +1 -1
- data/lib/geocodio/gem.rb +7 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a23532352c20b357e9f3bfb9fd0d1cae3eba81046b69aa5c4ff25cf35f53009
|
|
4
|
+
data.tar.gz: 417186d49921cb2b834bd482eeda1d10f063a7a04a1205762d39f976cecdbc00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8389b4c26144320878f1c2cd89a4b956d3645a393c52d0588a519c54940531cc4841977dc99bd9bcb88f0132b21ca3091a6f5e88fac6117605944b51e36980f
|
|
7
|
+
data.tar.gz: 415cf6424dfa744cf3edce336503022e73524a80e6e451a0065da0c1fd340083b19e2e38c95b9cbbc76ae8edbd829021f783673c972cfeefb8630820e78aff92
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.3.0] - 2026-10-30
|
|
2
|
+
- Documented AU support, including AU-specific appends (`au-census`, `au-demographics`, `au-housing`, `au-income`, etc.) and an AU address in the batch geocoding example
|
|
3
|
+
- Added a spec covering AU-specific field appends
|
|
4
|
+
|
|
5
|
+
## [2.2.0] - 2026-10-12
|
|
6
|
+
- Added the `calculation_type` option to `distanceMatrix()` and `createDistanceMatrixJob()`. Pass `calculation_type: :pairs` to measure each origin only against the destination at the same position, instead of the default full matrix (`:matrix`)
|
|
7
|
+
|
|
1
8
|
## [2.1.0] - 2026-10-06
|
|
2
9
|
- Documented UK support, including UK-specific appends (`uk-westminster`, `uk-devolved`, `uk-local`) and a UK address in the batch geocoding example
|
|
3
10
|
- Added a spec covering UK-specific field appends
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
geocodio-gem (2.
|
|
4
|
+
geocodio-gem (2.3.0)
|
|
5
5
|
csv (~> 3.0)
|
|
6
6
|
faraday (>= 2.14.3)
|
|
7
7
|
faraday-follow_redirects (>= 0.3.0)
|
|
@@ -18,23 +18,26 @@ GEM
|
|
|
18
18
|
crack (1.0.1)
|
|
19
19
|
bigdecimal
|
|
20
20
|
rexml
|
|
21
|
-
csv (3.3.
|
|
21
|
+
csv (3.3.7)
|
|
22
22
|
diff-lcs (1.5.0)
|
|
23
23
|
dotenv (2.8.1)
|
|
24
|
-
faraday (2.
|
|
25
|
-
faraday-net_http (>= 2.0, < 3.
|
|
24
|
+
faraday (2.15.1)
|
|
25
|
+
faraday-net_http (>= 2.0, < 3.6)
|
|
26
26
|
json
|
|
27
27
|
logger
|
|
28
28
|
faraday-follow_redirects (0.5.0)
|
|
29
29
|
faraday (>= 1, < 3)
|
|
30
|
-
faraday-net_http (3.
|
|
30
|
+
faraday-net_http (3.5.0)
|
|
31
31
|
net-http (~> 0.5)
|
|
32
32
|
hashdiff (1.0.1)
|
|
33
|
-
json (3.0
|
|
33
|
+
json (3.1.0)
|
|
34
34
|
logger (1.7.0)
|
|
35
35
|
method_source (1.0.0)
|
|
36
|
-
net-http (0.
|
|
36
|
+
net-http (0.10.0)
|
|
37
|
+
net-protocol (>= 0.3.0)
|
|
37
38
|
uri (>= 0.11.1)
|
|
39
|
+
net-protocol (0.4.0)
|
|
40
|
+
timeout
|
|
38
41
|
pry (0.14.1)
|
|
39
42
|
coderay (~> 1.1)
|
|
40
43
|
method_source (~> 1.0)
|
|
@@ -54,7 +57,8 @@ GEM
|
|
|
54
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
55
58
|
rspec-support (~> 3.12.0)
|
|
56
59
|
rspec-support (3.12.0)
|
|
57
|
-
|
|
60
|
+
timeout (0.6.1)
|
|
61
|
+
uri (1.1.2)
|
|
58
62
|
vcr (6.1.0)
|
|
59
63
|
webmock (3.18.1)
|
|
60
64
|
addressable (>= 2.8.0)
|
data/README.md
CHANGED
|
@@ -24,7 +24,7 @@ geocodio = Geocodio::Gem.new("YOUR_API_KEY")
|
|
|
24
24
|
|
|
25
25
|
### Geocoding
|
|
26
26
|
|
|
27
|
-
Forward geocoding takes an address and returns coordinates. Geocode a single address by using the `Geocodio::Gem#geocode` method. Pass in an address string within array brackets. We will parse the provided address and respond with a set of coordinates. Your results will return the most accurate locations first.
|
|
27
|
+
Forward geocoding takes an address and returns coordinates. Geocode a single address by using the `Geocodio::Gem#geocode` method. Pass in an address string within array brackets. We will parse the provided address and respond with a set of coordinates. Your results will return the most accurate locations first.
|
|
28
28
|
|
|
29
29
|
```ruby
|
|
30
30
|
results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201"])
|
|
@@ -32,10 +32,10 @@ results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201"])
|
|
|
32
32
|
results # => {"results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}]}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
To batch geocode a group of addresses, pass multiple address strings into the array. The Gem will automatically recognize the batch request and make the appropriate call.
|
|
35
|
+
To batch geocode a group of addresses, pass multiple address strings into the array. The Gem will automatically recognize the batch request and make the appropriate call.
|
|
36
36
|
|
|
37
37
|
```ruby
|
|
38
|
-
results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201", "12187 Darnestown Rd, Gaithersburg, MD 20878", "4961 Elm Street, Bethesda, MD", "10 Downing St, London, United Kingdom"])
|
|
38
|
+
results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201", "12187 Darnestown Rd, Gaithersburg, MD 20878", "4961 Elm Street, Bethesda, MD", "10 Downing St, London, United Kingdom", "30 Pitt St, Sydney NSW 2000, Australia"])
|
|
39
39
|
|
|
40
40
|
results # => {"results"=>[{"query"=>"1109 N Highland St, Arlington, VA 22201", "response"=>{"results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}]}}, {"query"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "response"=>{"results"=>[{"address_components"=>{"number"=>"12187", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118169, "lng"=>-77.251699}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12185", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12185 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118093, "lng"=>-77.25167}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12189", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12189 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118248, "lng"=>-77.251722}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12183", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12183 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117998, "lng"=>-77.25164}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}]}}, {"query"=>"4961 Elm Street, Bethesda, MD", "response"=>{"results"=>[{"address_components"=>{"number"=>"4961", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4961 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982196, "lng"=>-77.098161}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4959", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4959 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982198, "lng"=>-77.098084}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.98239, "lng"=>-77.097993}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982195, "lng"=>-77.098244}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}]}}]}
|
|
41
41
|
```
|
|
@@ -55,15 +55,15 @@ To batch geocode a multiple sets of coordinates, pass each latitude and longitud
|
|
|
55
55
|
```ruby
|
|
56
56
|
results = geocode.reverse(["38.88674717512318, -77.09464642536076", "39.118308110111954, -77.2516753863881", "38.98237295882022, -77.09805507289941"])
|
|
57
57
|
|
|
58
|
-
results # => {"results"=>[{"query"=>"38.88674717512318, -77.09464642536076", "response"=>{"results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}, {"address_components"=>{"number"=>"3030", "street"=>"Clarendon", "suffix"=>"Blvd", "formatted_street"=>"Clarendon Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3030 Clarendon Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.886876, "lng"=>-77.094702}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}, {"address_components"=>{"number"=>"3020", "street"=>"Clarendon", "suffix"=>"Blvd", "formatted_street"=>"Clarendon Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3020 Clarendon Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.886969, "lng"=>-77.094529}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Virginia Geographic Information Network (VGIN)"}, {"address_components"=>{"number"=>"3108", "predirectional"=>"N", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"N Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3108 N Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885773, "lng"=>-77.094955}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1027", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1027 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.885598, "lng"=>-77.09476}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3059", "predirectional"=>"N", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"N Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3059 N Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885574, "lng"=>-77.09456}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1079", "predirectional"=>"N", "street"=>"Hudson", "suffix"=>"St", "formatted_street"=>"N Hudson St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1079 N Hudson St, Arlington, VA 22201", "location"=>{"lat"=>38.885785, "lng"=>-77.095693}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3100", "street"=>"10th", "suffix"=>"Rd", "postdirectional"=>"N", "formatted_street"=>"10th Rd N", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3100 10th Rd N, Arlington, VA 22201", "location"=>{"lat"=>38.8852, "lng"=>-77.094709}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1015", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1015 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.885058, "lng"=>-77.094687}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1014", "predirectional"=>"N", "street"=>"Hudson", "suffix"=>"St", "formatted_street"=>"N Hudson St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1014 N Hudson St, Arlington, VA 22201", "location"=>{"lat"=>38.884985, "lng"=>-77.095586}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3201", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3201 Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885989, "lng"=>-77.096909}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}, {"query"=>"39.118308110111954, -77.2516753863881", "response"=>{"results"=>[{"address_components"=>{"number"=>"12191", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12191 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118326, "lng"=>-77.251749}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12189", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12189 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118248, "lng"=>-77.251722}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12193", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12193 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118376, "lng"=>-77.251707}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12187", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118169, "lng"=>-77.251699}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12185", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12185 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118093, "lng"=>-77.25167}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12184", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12184 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117781, "lng"=>-77.252536}, "accuracy"=>0.44, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"15998", "street"=>"Quince Orchard", "suffix"=>"Rd", "formatted_street"=>"Quince Orchard Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"15998 Quince Orchard Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117888, "lng"=>-77.25293}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12182", "street"=>"McDonald Chapel", "suffix"=>"Dr", "formatted_street"=>"McDonald Chapel Dr", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12182 McDonald Chapel Dr, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119427, "lng"=>-77.251898}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"15986", "street"=>"Quince Orchard", "suffix"=>"Rd", "formatted_street"=>"Quince Orchard Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"15986 Quince Orchard Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117709, "lng"=>-77.253041}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12218", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12218 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117983, "lng"=>-77.253546}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12135", "street"=>"McDonald Chapel", "suffix"=>"Dr", "formatted_street"=>"McDonald Chapel Dr", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12135 McDonald Chapel Dr, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119872, "lng"=>-77.25132}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1036", "street"=>"State Hwy 124", "formatted_street"=>"State Hwy 124", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"1036 State Hwy 124, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119961, "lng"=>-77.250987}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12114", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12114 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.116996, "lng"=>-77.249917}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}, {"query"=>"38.98237295882022, -77.09805507289941", "response"=>{"results"=>[{"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.98239, "lng"=>-77.097993}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4940", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4940 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.982529, "lng"=>-77.098032}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4959", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4959 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982198, "lng"=>-77.098084}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4957", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4957 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982201, "lng"=>-77.098002}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4962", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4962 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.98247, "lng"=>-77.098252}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4984", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4984 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982093, "lng"=>-77.097887}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7300", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"7300 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.982676, "lng"=>-77.098509}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"5000", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"5000 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.982676, "lng"=>-77.098509}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7249", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"7249 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.982036, "lng"=>-77.098479}, "accuracy"=>0.45, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"5000", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"5000 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982036, "lng"=>-77.09848}, "accuracy"=>0.45, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7400", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"7400 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.98334, "lng"=>-77.098548}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"4919", "street"=>"Montgomery", "suffix"=>"Ln", "formatted_street"=>"Montgomery Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4919 Montgomery Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.983371, "lng"=>-77.097503}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"4956", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4956 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982138, "lng"=>-77.096655}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}]}
|
|
58
|
+
results # => {"results"=>[{"query"=>"38.88674717512318, -77.09464642536076", "response"=>{"results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}, {"address_components"=>{"number"=>"3030", "street"=>"Clarendon", "suffix"=>"Blvd", "formatted_street"=>"Clarendon Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3030 Clarendon Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.886876, "lng"=>-77.094702}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}, {"address_components"=>{"number"=>"3020", "street"=>"Clarendon", "suffix"=>"Blvd", "formatted_street"=>"Clarendon Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3020 Clarendon Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.886969, "lng"=>-77.094529}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Virginia Geographic Information Network (VGIN)"}, {"address_components"=>{"number"=>"3108", "predirectional"=>"N", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"N Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3108 N Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885773, "lng"=>-77.094955}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1027", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1027 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.885598, "lng"=>-77.09476}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3059", "predirectional"=>"N", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"N Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3059 N Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885574, "lng"=>-77.09456}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1079", "predirectional"=>"N", "street"=>"Hudson", "suffix"=>"St", "formatted_street"=>"N Hudson St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1079 N Hudson St, Arlington, VA 22201", "location"=>{"lat"=>38.885785, "lng"=>-77.095693}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3100", "street"=>"10th", "suffix"=>"Rd", "postdirectional"=>"N", "formatted_street"=>"10th Rd N", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3100 10th Rd N, Arlington, VA 22201", "location"=>{"lat"=>38.8852, "lng"=>-77.094709}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1015", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1015 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.885058, "lng"=>-77.094687}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1014", "predirectional"=>"N", "street"=>"Hudson", "suffix"=>"St", "formatted_street"=>"N Hudson St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1014 N Hudson St, Arlington, VA 22201", "location"=>{"lat"=>38.884985, "lng"=>-77.095586}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3201", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"3201 Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885989, "lng"=>-77.096909}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}, {"query"=>"39.118308110111954, -77.2516753863881", "response"=>{"results"=>[{"address_components"=>{"number"=>"12191", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12191 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118326, "lng"=>-77.251749}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12189", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12189 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118248, "lng"=>-77.251722}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12193", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12193 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118376, "lng"=>-77.251707}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12187", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118169, "lng"=>-77.251699}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12185", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12185 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118093, "lng"=>-77.25167}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12184", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12184 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117781, "lng"=>-77.252536}, "accuracy"=>0.44, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"15998", "street"=>"Quince Orchard", "suffix"=>"Rd", "formatted_street"=>"Quince Orchard Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"15998 Quince Orchard Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117888, "lng"=>-77.25293}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12182", "street"=>"McDonald Chapel", "suffix"=>"Dr", "formatted_street"=>"McDonald Chapel Dr", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12182 McDonald Chapel Dr, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119427, "lng"=>-77.251898}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"15986", "street"=>"Quince Orchard", "suffix"=>"Rd", "formatted_street"=>"Quince Orchard Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"15986 Quince Orchard Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117709, "lng"=>-77.253041}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12218", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12218 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117983, "lng"=>-77.253546}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12135", "street"=>"McDonald Chapel", "suffix"=>"Dr", "formatted_street"=>"McDonald Chapel Dr", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12135 McDonald Chapel Dr, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119872, "lng"=>-77.25132}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1036", "street"=>"State Hwy 124", "formatted_street"=>"State Hwy 124", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"1036 State Hwy 124, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119961, "lng"=>-77.250987}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12114", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20878", "country"=>"US"}, "formatted_address"=>"12114 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.116996, "lng"=>-77.249917}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}, {"query"=>"38.98237295882022, -77.09805507289941", "response"=>{"results"=>[{"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.98239, "lng"=>-77.097993}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4940", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4940 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.982529, "lng"=>-77.098032}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4959", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4959 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982198, "lng"=>-77.098084}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4957", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4957 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982201, "lng"=>-77.098002}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4962", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4962 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.98247, "lng"=>-77.098252}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4984", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4984 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982093, "lng"=>-77.097887}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7300", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"7300 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.982676, "lng"=>-77.098509}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"5000", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"5000 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.982676, "lng"=>-77.098509}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7249", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"7249 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.982036, "lng"=>-77.098479}, "accuracy"=>0.45, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"5000", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"5000 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982036, "lng"=>-77.09848}, "accuracy"=>0.45, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7400", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"7400 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.98334, "lng"=>-77.098548}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"4919", "street"=>"Montgomery", "suffix"=>"Ln", "formatted_street"=>"Montgomery Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4919 Montgomery Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.983371, "lng"=>-77.097503}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"4956", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state_province"=>"MD", "postal_code"=>"20814", "country"=>"US"}, "formatted_address"=>"4956 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982138, "lng"=>-77.096655}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}]}
|
|
59
59
|
```
|
|
60
60
|
### Appending Fields
|
|
61
61
|
|
|
62
|
-
If you would like to append data fields to your results, you can do so by passing in a second array after the array that contains your addresses or coordinates. Be sure to separate these arrays by a comma. Within the second array, provide a string of the parameter name of the field you would like to append. For example, if you require timezones added to your results, you would use "timezone".
|
|
62
|
+
If you would like to append data fields to your results, you can do so by passing in a second array after the array that contains your addresses or coordinates. Be sure to separate these arrays by a comma. Within the second array, provide a string of the parameter name of the field you would like to append. For example, if you require timezones added to your results, you would use "timezone".
|
|
63
63
|
|
|
64
64
|
For a complete list of data field parameters, reference the [Geocodio API documentation](https://www.geocod.io/docs/?shell#fields).
|
|
65
65
|
|
|
66
|
-
This will work for both the `Geocodio::Gem#geocode` and `Geocodio::Gem#reverse` methods.
|
|
66
|
+
This will work for both the `Geocodio::Gem#geocode` and `Geocodio::Gem#reverse` methods.
|
|
67
67
|
|
|
68
68
|
```ruby
|
|
69
69
|
results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201"], ["timezone"])
|
|
@@ -71,7 +71,7 @@ This will work for both the `Geocodio::Gem#geocode` and `Geocodio::Gem#reverse`
|
|
|
71
71
|
results # => {"results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington", "fields"=>{"timezone"=>{"name"=>"America/New_York", "utc_offset"=>-5, "observes_dst"=>true, "abbreviation"=>"EST", "source"=>"© OpenStreetMap contributors"}}}]}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
If you would like to append multiple data fields, pass each parameter that you require into the array as a separate string, divided by commas.
|
|
74
|
+
If you would like to append multiple data fields, pass each parameter that you require into the array as a separate string, divided by commas.
|
|
75
75
|
|
|
76
76
|
```ruby
|
|
77
77
|
results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201"], ["timezone", "stateleg"])
|
|
@@ -87,9 +87,17 @@ United Kingdom addresses support UK-specific appends such as Westminster and dev
|
|
|
87
87
|
results # => {"results"=>[{"address_components"=>{"number"=>"10", "street"=>"Downing", "suffix"=>"St", "formatted_street"=>"Downing St", "city"=>"London", "nation"=>"England", "postal_code"=>"SW1A 2AA", "country"=>"GB"}, "formatted_address"=>"10 Downing St, London SW1A 2AA", "location"=>{"lat"=>51.503541, "lng"=>-0.12767}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Contains OS data © Crown copyright. Contains PAF® data © Royal Mail Group Ltd.", "fields"=>{"uk_westminster"=>[{"district_type"=>"westminster_constituency", "gss_code"=>"E14001172", "ocd_id"=>"ocd-division/country:gb/part:eng/region:uki/ed:cities_of_london_and_westminster", "name"=>"Cities of London and Westminster", "is_upcoming_district"=>false, "source"=>"Office for National Statistics"}], "uk_local"=>[{"district_type"=>"ward", "gss_code"=>"E05013806", "ocd_id"=>"ocd-division/country:gb/part:eng/ward:e05013806", "name"=>"St James's", "is_upcoming_district"=>false, "source"=>"Office for National Statistics"}]}}]}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
Australian addresses support AU-specific appends such as federal and state electorates (`au-federal-electorate`, `au-state-electorate`) and ABS census data (`au-census`, `au-demographics`, `au-housing`, `au-income`). Use `au-federal-electorate-next` to return upcoming federal electorate boundary changes.
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
93
|
+
results = geocodio.geocode(["83 Torrens St, Braddon ACT 2612, Australia"], ["au-federal-electorate", "au-state-electorate"])
|
|
94
|
+
|
|
95
|
+
results # => {"results"=>[{"address_components"=>{"number"=>"83", "street"=>"Torrens", "suffix"=>"St", "formatted_street"=>"Torrens St", "city"=>"Braddon", "state_province"=>"ACT", "postal_code"=>"2612", "country"=>"AU"}, "formatted_address"=>"83 Torrens St, Braddon ACT 2612", "location"=>{"lat"=>-35.265582, "lng"=>149.135149}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide (ACT Addresses from ACTMapi ©ACT Government CC BY 4.0)", "fields"=>{"au_federal_electorate"=>[{"name"=>"Canberra", "code"=>"802", "ocd_id"=>"ocd-division/country:au/territory:act/federal_electorate:canberra", "state"=>"ACT", "proportion"=>1, "is_upcoming_district"=>false, "source"=>"Geoscape Australia"}], "au_state_electorate"=>[{"name"=>"Kurrajong", "code"=>"80003", "ocd_id"=>"ocd-division/country:au/territory:act/sldl:kurrajong", "state"=>"ACT", "chamber"=>"legislative_assembly", "proportion"=>1, "is_upcoming_district"=>false, "source"=>"Geoscape Australia"}]}}]}
|
|
96
|
+
```
|
|
97
|
+
|
|
90
98
|
### Limiting Results
|
|
91
99
|
|
|
92
|
-
Some results may return a collection of different possible matches to the address or coordinates you've provided. If you would like to limit the number of results you receive, you can add a `limit` parameter that will set a maximum amount of results to be returned.
|
|
100
|
+
Some results may return a collection of different possible matches to the address or coordinates you've provided. If you would like to limit the number of results you receive, you can add a `limit` parameter that will set a maximum amount of results to be returned.
|
|
93
101
|
|
|
94
102
|
Pass in the maximum amount of results you'd prefer after your fields array as a number.
|
|
95
103
|
|
|
@@ -98,7 +106,7 @@ Pass in the maximum amount of results you'd prefer after your fields array as a
|
|
|
98
106
|
|
|
99
107
|
# => {"results"=>[{"address_components"=>{"number"=>"1120", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1120 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886743, "lng"=>-77.095041}, "accuracy"=>1, "accuracy_type"=>"range_interpolation", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}
|
|
100
108
|
|
|
101
|
-
results_two = geocodio.geocode(["1120 N Highland St, Arlington, VA 22201"], [], 3)
|
|
109
|
+
results_two = geocodio.geocode(["1120 N Highland St, Arlington, VA 22201"], [], 3)
|
|
102
110
|
|
|
103
111
|
# => {{"results"=>[{"address_components"=>{"number"=>"1120", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1120 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886743, "lng"=>-77.095041}, "accuracy"=>1, "accuracy_type"=>"range_interpolation", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1120", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22201", "country"=>"US"}, "formatted_address"=>"1120 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886743, "lng"=>-77.09474}, "accuracy"=>0.9, "accuracy_type"=>"range_interpolation", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1120", "predirectional"=>"S", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"S Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state_province"=>"VA", "postal_code"=>"22204", "country"=>"US"}, "formatted_address"=>"1120 S Highland St, Arlington, VA 22204", "location"=>{"lat"=>38.860865, "lng"=>-77.089447}, "accuracy"=>0.8, "accuracy_type"=>"rooftop", "source"=>"Arlington"}]}}
|
|
104
112
|
|
|
@@ -106,11 +114,11 @@ Pass in the maximum amount of results you'd prefer after your fields array as a
|
|
|
106
114
|
results_two["results"].length # => 3
|
|
107
115
|
```
|
|
108
116
|
|
|
109
|
-
In this example, you can see that by limiting the `results` to 1, we only receive the first element of the returned array. When we limit the `results_two` to 3 in the second example, we receive the first three elements in the array.
|
|
117
|
+
In this example, you can see that by limiting the `results` to 1, we only receive the first element of the returned array. When we limit the `results_two` to 3 in the second example, we receive the first three elements in the array.
|
|
110
118
|
|
|
111
|
-
If you would rather not limit your results at all, you can enter `nil` or leave the third parameter blank.
|
|
119
|
+
If you would rather not limit your results at all, you can enter `nil` or leave the third parameter blank.
|
|
112
120
|
|
|
113
|
-
You can also limit `reverse` geocode requests.
|
|
121
|
+
You can also limit `reverse` geocode requests.
|
|
114
122
|
|
|
115
123
|
```ruby
|
|
116
124
|
results = geocodio.reverse(["38.9002898,-76.9990361"], [], 1)
|
|
@@ -122,19 +130,19 @@ You can also limit `reverse` geocode requests.
|
|
|
122
130
|
# => {"results"=>[{"address_components"=>{"number"=>"508", "street"=>"H", "suffix"=>"St", "postdirectional"=>"NE", "formatted_street"=>"H St NE", "city"=>"Washington", "county"=>"District of Columbia", "state_province"=>"DC", "postal_code"=>"20002", "country"=>"US"}, "formatted_address"=>"508 H St NE, Washington, DC 20002", "location"=>{"lat"=>38.900432, "lng"=>-76.999031}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide DC"}, {"address_components"=>{"number"=>"510", "street"=>"H", "suffix"=>"St", "postdirectional"=>"NE", "formatted_street"=>"H St NE", "city"=>"Washington", "county"=>"District of Columbia", "state_province"=>"DC", "postal_code"=>"20002", "country"=>"US"}, "formatted_address"=>"510 H St NE, Washington, DC 20002", "location"=>{"lat"=>38.900429, "lng"=>-76.998965}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide DC"}, {"address_components"=>{"number"=>"506", "street"=>"H", "suffix"=>"St", "postdirectional"=>"NE", "formatted_street"=>"H St NE", "city"=>"Washington", "county"=>"District of Columbia", "state_province"=>"DC", "postal_code"=>"20002", "country"=>"US"}, "formatted_address"=>"506 H St NE, Washington, DC 20002", "location"=>{"lat"=>38.900437, "lng"=>-76.999099}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide DC"}, {"address_components"=>{"number"=>"504", "street"=>"H", "suffix"=>"St", "postdirectional"=>"NE", "formatted_street"=>"H St NE", "city"=>"Washington", "county"=>"District of Columbia", "state_province"=>"DC", "postal_code"=>"20002", "country"=>"US"}, "formatted_address"=>"504 H St NE, Washington, DC 20002", "location"=>{"lat"=>38.900422, "lng"=>-76.999169}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide DC"}]}
|
|
123
131
|
|
|
124
132
|
results["results"].length # => 1
|
|
125
|
-
results_two["results"].length # => 4
|
|
133
|
+
results_two["results"].length # => 4
|
|
126
134
|
```
|
|
127
135
|
|
|
128
136
|
### Simple Formatting
|
|
129
137
|
|
|
130
|
-
The `simple` format parameter returns an alternative JSON response that is simplified and only includes the formatted address, lat, long, accuracy and source fields.
|
|
138
|
+
The `simple` format parameter returns an alternative JSON response that is simplified and only includes the formatted address, lat, long, accuracy and source fields.
|
|
131
139
|
|
|
132
|
-
To receive a `simple` response, include the string `"simple"` as the fourth argument after any limit you have set.
|
|
140
|
+
To receive a `simple` response, include the string `"simple"` as the fourth argument after any limit you have set.
|
|
133
141
|
|
|
134
|
-
Currently, the `simple` format only works with single `geocode` and `reverse` input. It does not support batch requests.
|
|
142
|
+
Currently, the `simple` format only works with single `geocode` and `reverse` input. It does not support batch requests.
|
|
135
143
|
|
|
136
|
-
```ruby
|
|
137
|
-
## EXAMPLE: Forward geocoding simple formatting without data appends or limit.
|
|
144
|
+
```ruby
|
|
145
|
+
## EXAMPLE: Forward geocoding simple formatting without data appends or limit.
|
|
138
146
|
|
|
139
147
|
response = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201"], [], nil, "simple")
|
|
140
148
|
|
|
@@ -164,11 +172,11 @@ Responses are returned parsed and verbatim, so warnings are read straight off th
|
|
|
164
172
|
|
|
165
173
|
Warnings show up in a few places, depending on what raised them:
|
|
166
174
|
|
|
167
|
-
| Where
|
|
168
|
-
|
|
|
169
|
-
| `response["_warnings"]`
|
|
170
|
-
| `response["results"][i]["response"]["_warnings"]` | Batch `geocode` and `reverse` — warnings are attached per address
|
|
171
|
-
| `response["results"][i]["_warnings"]`
|
|
175
|
+
| Where | Applies to |
|
|
176
|
+
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
177
|
+
| `response["_warnings"]` | Single `geocode` and `reverse`, and the Lists API and distance matrix job methods |
|
|
178
|
+
| `response["results"][i]["response"]["_warnings"]` | Batch `geocode` and `reverse` — warnings are attached per address |
|
|
179
|
+
| `response["results"][i]["_warnings"]` | An individual geocoding result, e.g. an `ffiec` append skipped because the match is not street-level |
|
|
172
180
|
|
|
173
181
|
The gem does not raise on error responses — it returns the parsed error body — so warnings attached to a failed request are read the same way:
|
|
174
182
|
|
|
@@ -184,22 +192,22 @@ The gem does not raise on error responses — it returns the parsed error body
|
|
|
184
192
|
|
|
185
193
|
## Lists API
|
|
186
194
|
|
|
187
|
-
The Geocodio Lists API allows you to upload and process a spreadsheet with addresses or coordinates. This is very similar to our [Spreadsheet Uploader]("https://geocod.io/upload") tool. While your spreadsheet is being processed, you can also query the status of its current progress, download the final result or delete it from your records.
|
|
195
|
+
The Geocodio Lists API allows you to upload and process a spreadsheet with addresses or coordinates. This is very similar to our [Spreadsheet Uploader]("https://geocod.io/upload") tool. While your spreadsheet is being processed, you can also query the status of its current progress, download the final result or delete it from your records.
|
|
188
196
|
|
|
189
|
-
You will continue to use the `Geocodio##Gem` class you created in the Setup portion so that you can access the Lists API methods.
|
|
197
|
+
You will continue to use the `Geocodio##Gem` class you created in the Setup portion so that you can access the Lists API methods.
|
|
190
198
|
|
|
191
199
|
### Create A List
|
|
192
200
|
|
|
193
201
|
Create a new spreadsheet list job by utilizing the `createList()` method. To upload a spreadsheet file, pass following arguments into the method:
|
|
194
|
-
- file: The location of the file to be geocoded.
|
|
195
|
-
- filename: File extension is used to determine the file format. Valid formats include: CSV, TSV, XLS, XLSX.
|
|
196
|
-
- direction: Identify whether you will be `forward` geocoding or `reverse` geocoding.
|
|
197
|
-
- format: Provide a template for how addresses or coordinates should be read from the spreadsheet. For example:
|
|
202
|
+
- file: The location of the file to be geocoded.
|
|
203
|
+
- filename: File extension is used to determine the file format. Valid formats include: CSV, TSV, XLS, XLSX.
|
|
204
|
+
- direction: Identify whether you will be `forward` geocoding or `reverse` geocoding.
|
|
205
|
+
- format: Provide a template for how addresses or coordinates should be read from the spreadsheet. For example:
|
|
198
206
|
- Full address in column A: {{A}}
|
|
199
207
|
- Street adresses in column A, Zip in column D: {{A}} {{D}}
|
|
200
208
|
- Street name in A, City in B, State in C, Zip in D: {{A}} {{B}} {{C}} {{D}}
|
|
201
209
|
- [More examples here.]("https://www.geocod.io/docs/?shell#create-a-new-list")
|
|
202
|
-
- callback: Optional parameter. A valid URL that a webhook should be sent to upon completion of the spreadsheet geocoding job.
|
|
210
|
+
- callback: Optional parameter. A valid URL that a webhook should be sent to upon completion of the spreadsheet geocoding job.
|
|
203
211
|
|
|
204
212
|
```ruby
|
|
205
213
|
response = geocodio.createList(File.read("sample_list_test.csv"), "sample_list_test.csv", "forward", "{{A}} {{B}} {{C}} {{D}}")
|
|
@@ -208,7 +216,7 @@ Create a new spreadsheet list job by utilizing the `createList()` method. To upl
|
|
|
208
216
|
```
|
|
209
217
|
### Check List Status
|
|
210
218
|
|
|
211
|
-
To check the current status of your List API spreadsheet upload, use the `getList()` method. Pass in the ID generated when you created your List to identify which list you'd like to check.
|
|
219
|
+
To check the current status of your List API spreadsheet upload, use the `getList()` method. Pass in the ID generated when you created your List to identify which list you'd like to check.
|
|
212
220
|
|
|
213
221
|
```ruby
|
|
214
222
|
response = geocodio.getList(11599178)
|
|
@@ -217,7 +225,7 @@ To check the current status of your List API spreadsheet upload, use the `getLis
|
|
|
217
225
|
```
|
|
218
226
|
### Check All Lists
|
|
219
227
|
|
|
220
|
-
If you'd like to see all of the list jobs that you have created, use the `getAllLists` method. You don't need to pass anything as an argument. The endpoint is paginated, showing 15 lists at a time, ordered by most recent.
|
|
228
|
+
If you'd like to see all of the list jobs that you have created, use the `getAllLists` method. You don't need to pass anything as an argument. The endpoint is paginated, showing 15 lists at a time, ordered by most recent.
|
|
221
229
|
|
|
222
230
|
```ruby
|
|
223
231
|
response = geocodio.getAllLists
|
|
@@ -226,30 +234,30 @@ If you'd like to see all of the list jobs that you have created, use the `getAll
|
|
|
226
234
|
```
|
|
227
235
|
### Download A List
|
|
228
236
|
|
|
229
|
-
Download a spreadsheet file by using the `downloadList()` method. Pass in the ID you received during list creation to identify the list you would like to download. If the spreadsheet is finished processing, you will be redirected to a link that will automatically download the file.
|
|
237
|
+
Download a spreadsheet file by using the `downloadList()` method. Pass in the ID you received during list creation to identify the list you would like to download. If the spreadsheet is finished processing, you will be redirected to a link that will automatically download the file.
|
|
230
238
|
|
|
231
|
-
```ruby
|
|
239
|
+
```ruby
|
|
232
240
|
response = geocodio.downloadList(id)
|
|
233
241
|
|
|
234
242
|
If the file is finished processing:
|
|
235
243
|
|
|
236
244
|
response # => [address,city,state,zip,Latitude,Longitude,"Accuracy Score","Accuracy Type",Number,Street,"Unit Type","Unit Number",City,State,County,Zip,Country,Source], ["660 Pennsylvania Ave SE",Washington,DC,20003,38.885172,-76.996565,1,rooftop,660,"Pennsylvania Ave SE",,,Washington,DC,"District of Columbia",20003,US,Statewide],["1718 14th St NW",Washington,DC,20009,38.913274,-77.032266,1,rooftop,1718,"14th St NW",,,Washington,DC,"District of Columbia",20009,US,Statewide], ["1309 5th St NE",,,20002,38.908724,-76.997653,0.9,rooftop,1309,"5th St NE",,,Washington,DC,"District of Columbia",20002,US,Statewide], ["2150 P St NW",,,20037,38.90948,-77.048527,1,rooftop,2150,"P St NW",,,Washington,DC,"District of Columbia",20037,US,Statewide],["201 F Street NE",,,20002,38.897139,-77.003286,0.9,rooftop,201,"F St NE",,,Washington,DC,"District of Columbia",20002,US,Statewide],["1001 2nd St SE",,,20003,38.877737,-77.003695,1,rooftop,1001,"2nd St SE",,,Washington,DC,"District of Columbia",20003,US,Statewide],["1645 Wisconsin Avenue NW",Washington,DC,20007,38.911626,-77.065281,1,rooftop,1645,"Wisconsin Ave NW",,,Washington,DC,"District of Columbia",20007,US,Statewide],["820 East Baltimore Street",Baltimore,MD,21202,39.290427,-76.60485,1,rooftop,820,"E Baltimore St",,,Baltimore,MD,"Baltimore City",21202,US,"City of Baltimore"],["800 F St NW",Washington,DC,20001,38.896987,-77.023286,1,rooftop,800,"F St NW",,,Washington,DC,"District of Columbia",20004,US,Statewide],["700 Constitution Avenue NW",Washington,DC,20565,38.892228,-77.0219,0.9,range_interpolation,700,"Constitution Ave NW",,,Washington,DC,"District of Columbia",20002,US,"TIGER/Line® dataset from the US Census Bureau"],["1123 Pennsylvania Ave SE",Washington,DC,20003,38.882097,-76.990714,1,rooftop,1123,"Pennsylvania Ave SE",,,Washington,DC,"District of Columbia",20003,US,Statewide],["621 Pennsylvania Ave SE",Washington,DC,20003,38.884906,-76.997682,1,rooftop,621,"Pennsylvania Ave SE",,,Washington,DC,"District of Columbia",20003,US,Statewide],["1702 G Street NW",Washington,DC,20006,38.89816,-77.039982,1,rooftop,1702,"G St NW",,,Washington,DC,"District of Columbia",20006,US,Statewide],["701 8th St SE",Washington,DC,20003,38.881115,-76.995245,1,rooftop,701,"8th St SE",,,Washington,DC,"District of Columbia",20003,US,Statewide],["12187 Darnestown Rd",Gaithersburg,MD,20878,39.118169,-77.251699,1,rooftop,12187,"Darnestown Rd",,,Gaithersburg,MD,"Montgomery County",20878,US,Montgomery],["4961 Elm Street",Bethesda,MD,,38.982196,-77.098161,1,rooftop,4961,"Elm St",,,Bethesda,MD,"Montgomery County",20814,US,Montgomery],["3064 Mount Pleasant St NW",Washington,DC,,38.92846,-77.037509,1,rooftop,3064,"Mt Pleasant St NW",,,Washington,DC,"District of Columbia",20009,US,Statewide],["1052 Thomas Jefferson Street NW",Washington,DC,,38.903887,-77.060437,1,rooftop,1052,"Thomas Jefferson St NW",,,Washington,DC,"District of Columbia",20007,US,Statewide],["475 H St NW",Washington,DC,,38.900078,-77.018645,1,rooftop,475,"H St NW",,,Washington,DC,"District of Columbia",20001,US,Statewide],["1301 U St NW",Washington,DC,,38.917294,-77.03052,1,rooftop,1301,"U St NW",,,Washington,DC,"District of Columbia",20009,US,Statewide],["1726 20th Street, NW",Washington,DC,,38.913694,-77.045095,1,rooftop,1726,"20th St NW",,,Washington,DC,"District of Columbia",20009,US,Statewide],["1916 I Street, NW",Washington,DC,,38.90115,-77.044172,1,rooftop,1916,"I St NW",,,Washington,DC,"District of Columbia",20006,US,Statewide],["107 Church St NE",Vienna,VA,,38.902565,-77.265693,1,rooftop,107,"Church St NE",,,Vienna,VA,"Fairfax County",22180,US,Fairfax],["4817 Bethesda Ave",Bethesda,MD,20814,38.981067,-77.096506,1,rooftop,4817,"Bethesda Ave",,,Bethesda,MD,"Montgomery County",20814,US,Montgomery]
|
|
237
245
|
|
|
238
|
-
If the file is not finished processing:
|
|
246
|
+
If the file is not finished processing:
|
|
239
247
|
|
|
240
248
|
response # => {
|
|
241
249
|
"message": "List is still processing",
|
|
242
250
|
"success": false
|
|
243
|
-
}
|
|
251
|
+
}
|
|
244
252
|
```
|
|
245
253
|
|
|
246
254
|
### Delete A List
|
|
247
255
|
|
|
248
|
-
Delete an existing list by utilizing the `deleteList()` method. If the job is complete, this will delete both the list data and the spreadsheet data contained within. The spreadsheet data will be automatically deleted in 72 hours if it is not manually deleted using `deleteList()`.
|
|
256
|
+
Delete an existing list by utilizing the `deleteList()` method. If the job is complete, this will delete both the list data and the spreadsheet data contained within. The spreadsheet data will be automatically deleted in 72 hours if it is not manually deleted using `deleteList()`.
|
|
249
257
|
|
|
250
|
-
You can also use this method to cancel a current list job while it is still processing. Geocodio Unlimited customers can cancel a spreadsheet at any time, while Pay-As-You-Go customers can only do so if the spreadsheet job was started recently.
|
|
258
|
+
You can also use this method to cancel a current list job while it is still processing. Geocodio Unlimited customers can cancel a spreadsheet at any time, while Pay-As-You-Go customers can only do so if the spreadsheet job was started recently.
|
|
251
259
|
|
|
252
|
-
To use `deleteList()`, pass in the ID of the list you would like to delete.
|
|
260
|
+
To use `deleteList()`, pass in the ID of the list you would like to delete.
|
|
253
261
|
|
|
254
262
|
```ruby
|
|
255
263
|
response = geocodio.deleteList(11599181)
|
|
@@ -385,6 +393,29 @@ response = geocodio.distanceMatrix(
|
|
|
385
393
|
)
|
|
386
394
|
```
|
|
387
395
|
|
|
396
|
+
#### One-to-One Pairs
|
|
397
|
+
|
|
398
|
+
By default, every origin is measured against every destination. Pass `calculation_type: :pairs` to measure each origin only against the destination at the same position: the first origin against the first destination, the second against the second, and so on. Use it when you already know which trips you want, such as a list of commutes.
|
|
399
|
+
|
|
400
|
+
```ruby
|
|
401
|
+
origins = [
|
|
402
|
+
"38.8977,-77.0365,home",
|
|
403
|
+
"38.886672,-77.094735,office"
|
|
404
|
+
]
|
|
405
|
+
destinations = [
|
|
406
|
+
"38.9072,-77.0369,capitol",
|
|
407
|
+
"38.8895,-77.0353,monument"
|
|
408
|
+
]
|
|
409
|
+
|
|
410
|
+
response = geocodio.distanceMatrix(origins, destinations, calculation_type: :pairs)
|
|
411
|
+
|
|
412
|
+
response["results"][0]["origin"]["id"] # => "home"
|
|
413
|
+
response["results"][0]["destinations"].length # => 1
|
|
414
|
+
response["results"][0]["destinations"][0]["id"] # => "capitol"
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
`calculation_type` accepts `:matrix` (the default) or `:pairs`, as a symbol or a string. With `:pairs`, origins and destinations must be the same length, and the API rejects the `max_results`, `max_distance`, `max_duration`, `min_distance` and `min_duration` filters. The option applies to `distanceMatrix` and `createDistanceMatrixJob` only.
|
|
418
|
+
|
|
388
419
|
### Add Distance to Geocoding Requests
|
|
389
420
|
|
|
390
421
|
You can add distance calculations to existing geocode or reverse geocode requests:
|
|
@@ -437,6 +468,16 @@ job = geocodio.createDistanceMatrixJob(
|
|
|
437
468
|
|
|
438
469
|
job["id"] # => Job identifier
|
|
439
470
|
|
|
471
|
+
# Measure one-to-one pairs instead of a full matrix
|
|
472
|
+
job = geocodio.createDistanceMatrixJob(
|
|
473
|
+
"Commutes",
|
|
474
|
+
["38.8977,-77.0365,home", "38.886672,-77.094735,office"],
|
|
475
|
+
["38.9072,-77.0369,capitol", "38.8895,-77.0353,monument"],
|
|
476
|
+
calculation_type: :pairs
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
job["calculation_type"] # => "pairs"
|
|
480
|
+
|
|
440
481
|
# Or use list IDs from previously uploaded lists
|
|
441
482
|
job = geocodio.createDistanceMatrixJob(
|
|
442
483
|
"Distance from Lists",
|
|
@@ -472,27 +513,27 @@ geocodio.deleteDistanceMatrixJob(job["id"])
|
|
|
472
513
|
|
|
473
514
|
All distance methods support the following filtering options:
|
|
474
515
|
|
|
475
|
-
| Option
|
|
476
|
-
|
|
477
|
-
| `mode`
|
|
478
|
-
| `units`
|
|
479
|
-
| `max_results`
|
|
480
|
-
| `max_distance` | Float
|
|
481
|
-
| `min_distance` | Float
|
|
482
|
-
| `max_duration` | Integer | Filter by max duration in seconds (driving mode only)
|
|
483
|
-
| `min_duration` | Integer | Filter by min duration in seconds (driving mode only)
|
|
484
|
-
| `order_by`
|
|
485
|
-
| `sort`
|
|
516
|
+
| Option | Type | Description |
|
|
517
|
+
| -------------- | ------- | ------------------------------------------------------ |
|
|
518
|
+
| `mode` | Symbol | `:straightline` (default), `:driving`, or `:haversine` |
|
|
519
|
+
| `units` | Symbol | `:miles` (default), `:kilometers`, or `:km` |
|
|
520
|
+
| `max_results` | Integer | Limit number of results |
|
|
521
|
+
| `max_distance` | Float | Filter by maximum distance |
|
|
522
|
+
| `min_distance` | Float | Filter by minimum distance |
|
|
523
|
+
| `max_duration` | Integer | Filter by max duration in seconds (driving mode only) |
|
|
524
|
+
| `min_duration` | Integer | Filter by min duration in seconds (driving mode only) |
|
|
525
|
+
| `order_by` | Symbol | `:distance` (default) or `:duration` |
|
|
526
|
+
| `sort` | Symbol | `:asc` (default) or `:desc` |
|
|
486
527
|
|
|
487
528
|
## Testing
|
|
488
529
|
|
|
489
|
-
To run tests, be sure to create a `.env` file that export your Geocodio API Key within a variable of API_KEY.
|
|
530
|
+
To run tests, be sure to create a `.env` file that export your Geocodio API Key within a variable of API_KEY.
|
|
490
531
|
|
|
491
532
|
```ruby
|
|
492
533
|
export API_KEY=<YOUR API KEY>
|
|
493
534
|
```
|
|
494
535
|
|
|
495
|
-
Then, run `rspec`.
|
|
536
|
+
Then, run `rspec`.
|
|
496
537
|
|
|
497
538
|
```ruby
|
|
498
539
|
rspec
|
|
@@ -500,7 +541,7 @@ Then, run `rspec`.
|
|
|
500
541
|
|
|
501
542
|
## Changelog
|
|
502
543
|
|
|
503
|
-
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
|
|
544
|
+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
|
|
504
545
|
|
|
505
546
|
## License
|
|
506
547
|
|
data/lib/geocodio/gem/version.rb
CHANGED
data/lib/geocodio/gem.rb
CHANGED
|
@@ -186,7 +186,10 @@ module Geocodio
|
|
|
186
186
|
# Calculate distance matrix from multiple origins to multiple destinations
|
|
187
187
|
# @param origins [Array] Array of origin coordinates
|
|
188
188
|
# @param destinations [Array] Array of destination coordinates
|
|
189
|
-
# @param options [Hash] Same options as distance() method
|
|
189
|
+
# @param options [Hash] Same options as distance() method, plus:
|
|
190
|
+
# - calculation_type: :matrix (default, every origin against every destination)
|
|
191
|
+
# or :pairs (origin i against destination i only; origins and destinations
|
|
192
|
+
# must be the same length, and the max_*/min_* filters are not available)
|
|
190
193
|
def distanceMatrix(origins, destinations, options = {})
|
|
191
194
|
raise ArgumentError, 'Please provide at least one origin.' if origins.nil? || origins.empty?
|
|
192
195
|
raise ArgumentError, 'Please provide at least one destination.' if destinations.nil? || destinations.empty?
|
|
@@ -215,6 +218,7 @@ module Geocodio
|
|
|
215
218
|
# @param destinations [Array, Integer] Array of coordinates or list ID
|
|
216
219
|
# @param options [Hash] Same options as distanceMatrix() plus:
|
|
217
220
|
# - callback_url: URL for webhook notification
|
|
221
|
+
# - calculation_type: :matrix (default) or :pairs, as for distanceMatrix()
|
|
218
222
|
def createDistanceMatrixJob(name, origins, destinations, options = {})
|
|
219
223
|
raise ArgumentError, 'Please provide a job name.' if name.nil? || name.empty?
|
|
220
224
|
raise ArgumentError, 'Please provide origins.' if origins.nil?
|
|
@@ -367,6 +371,8 @@ module Geocodio
|
|
|
367
371
|
def build_distance_body_params(options)
|
|
368
372
|
params = {}
|
|
369
373
|
|
|
374
|
+
params[:calculation_type] = options[:calculation_type].to_s if options[:calculation_type]
|
|
375
|
+
|
|
370
376
|
# Mode (map haversine to straightline)
|
|
371
377
|
if options[:mode]
|
|
372
378
|
mode = options[:mode].to_s
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geocodio-gem
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GoldenPavilion
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-11-17 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: faraday
|
|
@@ -79,6 +80,7 @@ metadata:
|
|
|
79
80
|
homepage_uri: https://www.geocod.io/docs
|
|
80
81
|
source_code_uri: https://www.github.com/Geocodio/geocodio-gem/
|
|
81
82
|
changelog_uri: https://www.github.com/Geocodio/geocodio-gem/CHANGELOG.md
|
|
83
|
+
post_install_message:
|
|
82
84
|
rdoc_options: []
|
|
83
85
|
require_paths:
|
|
84
86
|
- lib
|
|
@@ -93,7 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
95
|
- !ruby/object:Gem::Version
|
|
94
96
|
version: '0'
|
|
95
97
|
requirements: []
|
|
96
|
-
rubygems_version:
|
|
98
|
+
rubygems_version: 3.5.22
|
|
99
|
+
signing_key:
|
|
97
100
|
specification_version: 4
|
|
98
101
|
summary: Geocodio Ruby Library.
|
|
99
102
|
test_files: []
|