geocoder-olleh 0.1.9 → 0.2.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/Gemfile +3 -1
- data/lib/geocoder/lookups/olleh.rb +24 -16
- data/lib/geocoder/olleh/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed52247a3bb4d999c891c3338c437a9957f1e1a0
|
4
|
+
data.tar.gz: 64f9a1d5615bfdb20bb2ebee3e58c3186cb4576b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb5a48b1600df4f4ddcd1d0e0bd530ff61b33fa2c860f02548f7e991bfdeb6a3eedd607da212271161bdfde3e5c8ef813815623e6118c6f6cbbb2985689f18a
|
7
|
+
data.tar.gz: 777e017630613477530ed7190e263fe9458d4805fb717422eebfdbf62f5baa006e8383b7c99082fc5c976044772119ce8c290af219d414a67609e7e128cfe049
|
data/Gemfile
CHANGED
@@ -3,12 +3,14 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in geocoder-olleh.gemspec
|
4
4
|
gem 'geocoder'
|
5
5
|
group :development, :test do
|
6
|
-
|
6
|
+
gem 'test-unit' # needed for Ruby >=2.2.0
|
7
7
|
gem 'guard'
|
8
8
|
gem 'guard-test'
|
9
9
|
gem 'coveralls'
|
10
10
|
gem 'pry'
|
11
11
|
gem 'pry-remote'
|
12
12
|
gem 'pry-nav'
|
13
|
+
gem 'vcr'
|
14
|
+
gem 'webmock'
|
13
15
|
end
|
14
16
|
gemspec
|
@@ -100,21 +100,27 @@ module Geocoder::Lookup
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def self.check_query_type(query)
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
103
|
+
|
104
|
+
options = query.options
|
105
|
+
return options[:query_type] if options[:query_type]
|
106
|
+
|
107
|
+
query_type = case
|
108
|
+
when options.include?(:priority)
|
109
|
+
'route_search'
|
110
|
+
when query.reverse_geocode? && options.include?(:include_jibun)
|
111
|
+
'reverse_geocoding'
|
112
|
+
when options.include?(:coord_in)
|
113
|
+
'convert_coord'
|
114
|
+
when options.include?(:l_code)
|
115
|
+
'addr_step_search'
|
116
|
+
when options.include?(:radius)
|
117
|
+
'addr_nearest_position_search'
|
113
118
|
else
|
114
|
-
|
119
|
+
'geocoding'
|
115
120
|
end
|
116
|
-
end
|
117
121
|
|
122
|
+
options[:query_type] = query_type
|
123
|
+
end
|
118
124
|
|
119
125
|
private # ----------------------------------------------
|
120
126
|
|
@@ -129,7 +135,10 @@ module Geocoder::Lookup
|
|
129
135
|
end
|
130
136
|
|
131
137
|
case Olleh.check_query_type(query)
|
132
|
-
when "geocoding"
|
138
|
+
when "geocoding"
|
139
|
+
return [] if doc['RESDATA']['COUNT'] == 0
|
140
|
+
return doc['RESDATA']["ADDRS"]
|
141
|
+
when "reverse_geocoding"
|
133
142
|
return [] if doc['RESDATA']['COUNT'] == 0
|
134
143
|
return doc['RESDATA']["ADDRS"]
|
135
144
|
when "route_search"
|
@@ -158,12 +167,11 @@ module Geocoder::Lookup
|
|
158
167
|
"https://openapi.kt.com/maps/search/AddrStepSearch?params="
|
159
168
|
when "addr_nearest_position_search"
|
160
169
|
"https://openapi.kt.com/maps/search/AddrNearestPosSearch?params="
|
161
|
-
else
|
170
|
+
else #geocoding
|
162
171
|
"https://openapi.kt.com/maps/geocode/GetGeocodeByAddr?params="
|
163
172
|
end
|
164
173
|
end
|
165
174
|
|
166
|
-
|
167
175
|
def query_url_params(query)
|
168
176
|
case Olleh.check_query_type(query)
|
169
177
|
when "route_search"
|
@@ -238,4 +246,4 @@ module Geocoder::Lookup
|
|
238
246
|
Geocoder.config[:cache_prefix] + query_url(query).split('timestamp')[0]
|
239
247
|
end
|
240
248
|
end
|
241
|
-
end
|
249
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocoder-olleh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaigouk Kim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06
|
11
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|