R/mp_get_points.R
mp_get_points.Rd
Extract geocoded points from Google Maps Geocode API response
mp_get_points(doc, all_results = FALSE)
XML document with Google Maps Geocode API response
The geocoder may return several results when address queries are ambiguous. Should all results be returned (TRUE
), or just the first one (FALSE
, default)?
sf
Point layer representing geocoded locations
library(xml2)
doc = list("Tel-Aviv" = as_xml_document(response_geocode))
pnt = mp_get_points(doc)
if (FALSE) {
key = readLines("~/key")
doc = mp_geocode(addresses = c("Rehovot", "Beer-Sheva", "New-York"), key = key)
pnt = mp_get_points(doc)
}