class Geocoder::Result::Geoapify
def address(_format = :full)
def address(_format = :full) properties['formatted'] end
def address_line1
def address_line1 properties['address_line1'] end
def address_line2
def address_line2 properties['address_line2'] end
def bounds
def bounds data['bbox'] end
def city
def city properties['city'] end
def coordinates
def coordinates return unless properties['lat'] return unless properties['lon'] [properties['lat'], properties['lon']] end
def country
def country properties['country'] end
def country_code
def country_code return unless properties['country_code'] properties['country_code'].upcase end
def county
def county properties['county'] end
def datasource
continent: 'North America',
osm_id: 138141251,
osm_type: 'W',
phone: '12124656741',
website: 'http://www.thegarden.com/',
wikipedia: 'en:Madison Square Garden',
wikidata: 'Q186125',
wheelchair: 'limited',
sourcename: 'openstreetmap',
{
Open
Examples:
def datasource return unless properties['datasource'] symbol_hash properties['datasource'] end
def distance
Distance in meters to given bias:proximity or to given coordinates for
def distance properties['distance'] end
def district
def district properties['district'] end
def geometry
See: https://tools.ietf.org/html/rfc7946#section-3.1
def geometry return unless data['geometry'] symbol_hash data['geometry'] end
def house_number
def house_number properties['housenumber'] end
def postal_code
def postal_code properties['postcode'] end
def properties
def properties @properties ||= data['properties'] || {} end
def rank
match_type: :full_match
confidence: 0.88,
popularity: 8.615793062435909,
{
Example:
* match_by_country_or_state
* match_by_city_or_disrict
* match_by_postcode
* match_by_street
* match_by_building
* inner_part
* full_match
* `match_type` - The result's match type, one of following:
* `confidence` - The confidence value of the result (0-1)
* `popularity` - The popularity score of the result
Calculated rank for the result, containing the following keys:
def rank return unless properties['rank'] r = symbol_hash(properties['rank']) r[:match_type] = r[:match_type].to_sym if r[:match_type] r end
def state
def state properties['state'] end
def state_code
def state_code '' end
def street
def street properties['street'] end
def suburb
def suburb properties['suburb'] end
def symbol_hash(orig_hash)
def symbol_hash(orig_hash) {}.tap do |result| orig_hash.each_key do |key| next unless orig_hash[key] result[key.to_sym] = orig_hash[key] end end end
def type
* :country
* :state
* :county
* :city
* :postcode
* :district
* :suburb
* :street
* :building
* :amenity
* :unknown
Type of the result, one of:
def type return :unknown unless properties['result_type'] properties['result_type'].to_sym end