# an instance must be mounted first
photon <- new_photon()
# geocode a city
geocode("Berlin")
# return more results
geocode("Berlin", limit = 10)
# return the results in german
geocode("Berlin", limit = 10, lang = "de")
# limit to cities
geocode("Berlin", layer = "city")
# limit to European cities
geocode("Berlin", bbox = c(xmin = -71.18, ymin = 44.46, xmax = 13.39, ymax = 52.52))
# search for museums in berlin
geocode("Berlin", osm_tag = "tourism:museum")
# search for touristic attractions in berlin
geocode("Berlin", osm_tag = "tourism")
# search for anything but tourism
geocode("Berlin", osm_tag = "!tourism")
# use location biases to match Berlin, IL instead of Berlin, DE
geocode("Berlin", locbias = c(-100, 40), locbias_scale = 0.1, zoom = 7, osm_tag = "place")
# latinization can help normalize search terms
geocode("Luatuanu\u2019u", latinize = FALSE) # fails
geocode("Luatuanu\u2019u", latinize = TRUE) # works
Run the code above in your browser using DataLab