geocoder-olleh 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geocoder/olleh/lookups/olleh.rb +7 -6
- data/lib/geocoder/olleh/results/olleh.rb +9 -0
- data/lib/geocoder/olleh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ca04cde0b87e5bc5f8c196176e4ecb9a2e3a7fb
|
4
|
+
data.tar.gz: 09b9d95cf3f6050d31923c8ab4c9c8c86460e81f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 648347a96b2c62f5b20c13952a74af18b1129023f8fc83d8818fbc39522961231aebb3d3b729c00b3490bfc7ab02262e9256d563b22215ab9f15a04a4624793f
|
7
|
+
data.tar.gz: 4f2a2971c5038a613e06998d6a73e3d4c2f7a2fd2889a7647c933dba97b50cd85e1f43712f5de3e05fb722b33acee5f01eef4b307cec310fa4688b93407e550a
|
@@ -101,21 +101,22 @@ module Geocoder::Lookup
|
|
101
101
|
data = fetch_data(query)
|
102
102
|
return [] unless data
|
103
103
|
doc = JSON.parse(URI.decode(data["payload"]))
|
104
|
-
|
105
104
|
if doc['ERRCD'] != 0
|
106
105
|
Geocoder.log(:warn, "Olleh API error: #{doc['ERRCD']} (#{doc['ERRMS'].gsub('+', ' ')}).")
|
107
106
|
return []
|
108
107
|
end
|
109
|
-
|
110
108
|
# GEOCODING / REVERSE GECOCODING
|
111
109
|
if doc['RESDATA']['COUNT']
|
112
110
|
return [] if doc['RESDATA']['COUNT'] == 0
|
113
111
|
return doc['RESDATA']["ADDRS"]
|
114
|
-
|
115
112
|
# ROUTE SEARCH
|
116
|
-
elsif doc[
|
117
|
-
return [] if doc[
|
118
|
-
return doc[
|
113
|
+
elsif doc['RESDATA']['SROUTE'] && doc['RESDATA']['SROUTE']['isRoute']
|
114
|
+
return [] if doc['RESDATA']['SROUTE']['isRoute'] == 'false'
|
115
|
+
return doc['RESDATA']
|
116
|
+
# CONVERT COORDINATES
|
117
|
+
elsif doc['RESDATA']['COORD'] && doc['RESDATA']['COORD']['COORDTYPE']
|
118
|
+
return [] if doc['RESDATA']['COORD']['X'] == ''
|
119
|
+
return doc['RESDATA']
|
119
120
|
else
|
120
121
|
[]
|
121
122
|
end
|
@@ -64,6 +64,15 @@ module Geocoder::Result
|
|
64
64
|
%w[bbox name confidence entityType]
|
65
65
|
end
|
66
66
|
|
67
|
+
#########
|
68
|
+
# CONVERTED COORD TYPE
|
69
|
+
def converted_coord_type
|
70
|
+
@data[1]['COORDTYPE']
|
71
|
+
end
|
72
|
+
|
73
|
+
def converted_coordinates
|
74
|
+
[@data[1]['X'], @data[1]['Y']]
|
75
|
+
end
|
67
76
|
|
68
77
|
#########
|
69
78
|
# methods for route search results
|