Description Usage Arguments Value See Also Examples
Reverse geocodes a location (based on spatial coordinates) to an address. It uses OpenStreetMap Nominatim. For processing large amount of queries, please read the usage policy (https://operations.osmfoundation.org/policies/nominatim/).
1 2 3 4 5 6 7 8 | rev_geocode_OSM(
x,
y = NULL,
zoom = NULL,
projection = 4326,
as.data.frame = NA,
server = "https://nominatim.openstreetmap.org"
)
|
x |
x coordinate(s), or a spatial points object ( |
y |
y coordinate(s) |
zoom |
zoom level |
projection |
projection in which the coordinates |
as.data.frame |
return as data.frame ( |
server |
OpenStreetMap Nominatim server name. Could also be a local OSM Nominatim server. |
A data frame or a list with all attributes that are contained in the search result
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
if (require(tmap)) {
data(metro)
# sample five cities from metro dataset
set.seed(1234)
five_cities <- metro[sample(length(metro), 5), ]
# obtain reverse geocode address information
addresses <- rev_geocode_OSM(five_cities, zoom = 6)
five_cities <- sf::st_sf(data.frame(five_cities, addresses))
# change to interactive mode
current.mode <- tmap_mode("view")
tm_shape(five_cities) +
tm_markers(text="name")
# restore current mode
tmap_mode(current.mode)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.