geocode | R Documentation |
A wrapper around the tidygeocoding and Wikipedia services. Users can request a data.frame (default), vector (xy = TRUE), point (pt = TRUE), and/or a bounding box (bbox = TRUE) representation of a place/location (geo) or event. One or more can be given at a time.
If a single entitiy is requested, 'geocode' will provide a data.frame of lat/lon values and, if requested, a point object and the derived bounding box of the geo/event.
If multiple entities are requested, the returned objects will be a data.frame with columns for input name-lat-lon; if requested, a POINT object will be returned. Here, the bbox argument will return the minimum bounding box of all place names.
geocode(
geo = NULL,
event = NULL,
pt = FALSE,
bbox = FALSE,
all = FALSE,
xy = FALSE,
method = default_method,
crs = default_crs
)
geo |
|
event |
|
pt |
|
bbox |
|
all |
|
xy |
|
method |
the geocoding service to be used. See ?tidygeocoder::geocode |
crs |
desired CRS. Defaults to AOI::default_crs |
a data.frame, sf object, or vector
Other geocode:
geocode_rev()
,
geocode_wiki()
## Not run:
## geocode a single locations
geocode("UCSB")
## geocode a single location and return a POINT object
geocode("UCSB", pt = TRUE)
## geocode a single location and derived bbox of location
geocode(location = "UCSB", bbox = TRUE)
## geocode multiple locations
geocode(c("UCSB", "Goleta", "Santa Barbara"))
## geocode multiple points and generate a minimum bounding box of all locations and spatial points
geocode(c("UCSB", "Goleta", "Santa Barbara"), bbox = T, pt = T)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.