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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66f08a4d20c563a6a8410bd289685557110a8827
4
- data.tar.gz: 71365cd47aaeddb98c1e227793f38ec3fe666fe7
3
+ metadata.gz: 2ca04cde0b87e5bc5f8c196176e4ecb9a2e3a7fb
4
+ data.tar.gz: 09b9d95cf3f6050d31923c8ab4c9c8c86460e81f
5
5
  SHA512:
6
- metadata.gz: d67e65322e1afcfcc1f9dee80ef1121acaba9bb0496f3ccc04f9f8188ee3efeae1265ed13007b72774bf30e354328574586dd7d63d631025268178ef46e9d9bb
7
- data.tar.gz: afadc38dc630ffee31908233c6c6c844f1443bb375fe06b6a9c078a8d0b6169ead7acb977f48f7ea7283eda6546647562a8480dccf099a1fe9a17759afc981bd
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["RESDATA"]["SROUTE"] && doc["RESDATA"]["SROUTE"]["isRoute"]
117
- return [] if doc["RESDATA"]["SROUTE"]["isRoute"] == "false"
118
- return doc["RESDATA"]
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
@@ -1,5 +1,5 @@
1
1
  module Geocoder
2
2
  module Olleh
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geocoder-olleh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaigouk Kim