class Geocoder::Result::Olleh
Public Class Methods
response_attributes()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 76 def self.response_attributes %w[bbox name confidence entityType] end
Public Instance Methods
addr_step_dong()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 126 def addr_step_dong @data["DONG"] end
addr_step_h_code()
click to toggle source
행정동코드
# File lib/geocoder/results/olleh.rb, line 140 def addr_step_h_code @data["H_CODE"] end
addr_step_l_code()
click to toggle source
법정동코드
# File lib/geocoder/results/olleh.rb, line 135 def addr_step_l_code @data["L_CODE"] end
addr_step_li()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 130 def addr_step_li @data["LI"] end
addr_step_p_code()
click to toggle source
파란코드
# File lib/geocoder/results/olleh.rb, line 145 def addr_step_p_code @data["P_CODE"] end
addr_step_sido()
click to toggle source
methods for parsing address step search
법정동 - 시도
# File lib/geocoder/results/olleh.rb, line 116 def addr_step_sido @data["SIDO"] end
addr_step_sigungu()
click to toggle source
법정동 - 시군구
# File lib/geocoder/results/olleh.rb, line 122 def addr_step_sigungu sanitize_addr(@data["SIGUNGU"]) end
address()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 14 def address @data['ADDRESS'].gsub('+', ' ') end
address_data()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 72 def address_data @data['ADDRESS'] end
city()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 18 def city @data['ADDRESS'].split('+').first end
converted_coord()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 87 def converted_coord [@data[1]["X"], @data[1]["Y"]] end
coord_type()
click to toggle source
methods for converting coord system
# File lib/geocoder/results/olleh.rb, line 83 def coord_type @data[1]['COORDTYPE'] end
coordinates()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 52 def coordinates [@data['X'], @data['Y']] end
country()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 42 def country "South Korea" end
Also aliased as: region, country_code
dong()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 26 def dong @data['ADDRESS'].split('+')[2] end
dong_code()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 30 def dong_code @data['DONG_CODE'] end
gu()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 22 def gu @data['ADDRESS'].split('+')[1] end
latitude()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 6 def latitude coordinates[0].to_f end
longitude()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 10 def longitude coordinates[1].to_f end
name()
click to toggle source
NAME used when we call km2_LocalSearch
# File lib/geocoder/results/olleh.rb, line 186 def name @data["NAME"] end
new_addr()
click to toggle source
addr used when we call km2_LocalSearch using new address system
# File lib/geocoder/results/olleh.rb, line 174 def new_addr if @data["NEW_ADDR"] sanitize_addr(@data["NEW_ADDR"]) elsif @data["M_NEWADDR1"] && @data["M_NEWADDR2"] sanitize_addr(@data["M_NEWADDR1"]) + " " + sanitize_addr(@data["M_NEWADDR2"]) else "" end end
old_addr()
click to toggle source
addr used when we call km2_LocalSearch using old address system
# File lib/geocoder/results/olleh.rb, line 159 def old_addr if @data["ADDR"] sanitize_addr(@data["ADDR"]) elsif @data["ADDRESS"] sanitize_addr(@data["ADDRESS"]) elsif @data["M_ADDR1"] sanitize_addr(@data["M_ADDR1"]) + " " + sanitize_addr(@data["M_ADDR2"]) else "" end end
position_address()
click to toggle source
methods for parsing nearest position search
# File lib/geocoder/results/olleh.rb, line 152 def position_address "#{@data['SIDO']} #{@data['L_SIGUN_GU']} #{@data['L_DONG']} #{@data['GIBUN']}" end
postal_code()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 48 def postal_code "" end
rg_count()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 104 def rg_count @data[1]['ROUTE']['rg_count'] end
rg_links()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 108 def rg_links @data[1]['ROUTE']['rg'] end
sanitize_addr(text)
click to toggle source
# File lib/geocoder/results/olleh.rb, line 202 def sanitize_addr(text) return unless text text.gsub("++", " ").gsub("+", " ") end
state_code()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 36 def state_code "" end
Also aliased as: state
total_dist()
click to toggle source
# File lib/geocoder/results/olleh.rb, line 100 def total_dist @data[1]['ROUTE']['total_dist'] end
total_time()
click to toggle source
methods for route search results total_time
: minutes total_dist
: meter
# File lib/geocoder/results/olleh.rb, line 96 def total_time @data[1]['ROUTE']['total_time'] end
wgs_coordinates()
click to toggle source
methods for returning wgs coordiates from
# File lib/geocoder/results/olleh.rb, line 59 def wgs_coordinates return @data["WGS_COORDINATES"] if @data["WGS_COORDINATES"] query = Geocoder::Query.new( coordinates, { coord_in: 'utmk', coord_out: 'wgs84' }) lookup = Geocoder::Lookup::Olleh.new wgs = lookup.search(query).first.converted_coord @data["WGS_COORDINATES"] = wgs wgs end
x()
click to toggle source
UTMK X coordinate used when we call km2_LocalSearch
# File lib/geocoder/results/olleh.rb, line 192 def x @data["X"] end
y()
click to toggle source
UTMK Y coordinate used when we call km2_LocalSearch
# File lib/geocoder/results/olleh.rb, line 198 def y @data["Y"] end