mp_get_points: Extract geocoded points from Google Maps Geocode API response

Description Usage Arguments Value Examples

View source: R/mp_get_points.R

Description

Extract geocoded points from Google Maps Geocode API response

Usage

1
mp_get_points(doc, all_results = FALSE)

Arguments

doc

XML document with Google Maps Geocode API response

all_results

The geocoder may return several results when address queries are ambiguous. Should all results be returned (TRUE), or just the first one (FALSE, default)?

Value

sf Point layer representing geocoded locations

Examples

1
2
3
4
5
6
7
8
library(xml2)
doc = list("Tel-Aviv" = as_xml_document(response_geocode))
pnt = mp_get_points(doc)
## Not run: 
doc = mp_geocode(addresses = c("Rehovot", "Beer-Sheva", "New-York"))
pnt = mp_get_points(doc)

## End(Not run)

michaeldorman/mapsapi documentation built on Oct. 4, 2018, 2:30 a.m.