mp_get_bounds: Extract geocoded *bounds* from Google Maps Geocode API...

Description Usage Arguments Value Examples

View source: R/mp_get_bounds.R

Description

Extract geocoded *bounds* from Google Maps Geocode API response

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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 documentation built on June 13, 2021, 5:07 p.m.