Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mp_get_bounds

Extract geocoded *bounds* from Google Maps Geocode API response


Description

Extract geocoded *bounds* from Google Maps Geocode API response

Usage

mp_get_bounds(doc)

Arguments

doc

XML document with Google Maps Geocode API response

Value

sf Polygonal layer representing bounds of geocoded locations. In cases when there is more than one response per address, only first response is considered.

Examples

# Built-in reponse example
library(xml2)
doc = list("Tel-Aviv" = as_xml_document(response_geocode))
b = mp_get_bounds(doc)

## Not run: 

# Text file with API key
key = readLines("~/key")

# Get bounds
doc = mp_geocode(addresses = c("Tel-Aviv", "Rehovot", "Beer-Sheva"), region = "il", key = key)
b = mp_get_bounds(doc)


## End(Not run)

mapsapi

'sf'-Compatible Interface to 'Google Maps' APIs

v0.4.8
MIT + file LICENSE
Authors
Michael Dorman [aut, cre], Tom Buckley [ctb], Alex Dannenberg [ctb], Mihir Bhaskar [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.