class Geocoder::Result::Photon

def address(_format = :full)

def address(_format = :full)
  parts = []
  parts << name if name
  parts << street_address if street_address
  parts << city
  parts << state if state
  parts << postal_code
  parts << country
  parts.join(', ')
end

def bounds

def bounds
  properties['extent']
end

def city

def city
  properties['city']
end

def coordinates

def coordinates
  return unless geometry
  return unless geometry[:coordinates]
  geometry[:coordinates].reverse
end

def country

def country
  properties['country']
end

def country_code

def country_code
  ''
end

def geometry

def geometry
  return unless data['geometry']
  symbol_hash data['geometry']
end

def house_number

def house_number
  properties['housenumber']
end

def name

def name
  properties['name']
end

def osm_id

def osm_id
  properties['osm_id']
end

def osm_tag

See: https://wiki.openstreetmap.org/wiki/Tags
def osm_tag
  return unless properties['osm_key']
  return properties['osm_key'] unless properties['osm_value']
  "#{properties['osm_key']}=#{properties['osm_value']}"
end

def postal_code

def postal_code
  properties['postcode']
end

def properties

def properties
  @properties ||= data['properties'] || {}
end

def state

def state
  properties['state']
end

def state_code

def state_code
  ''
end

def street

def street
  properties['street']
end

def street_address

def street_address
  return unless street
  return street unless house_number
  "#{house_number} #{street}"
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


:relation
:way
:node

Type of the result (OSM object type), one of:
def type
  {
    'N' => :node,
    'W' => :way,
    'R' => :relation
  }[properties['osm_type']]
end