geocode {mapmisc} | R Documentation |
Uses the dismo package to geocode with Google
geocode(x, extent, lang = gsub("(_|[:]).*", "", Sys.getenv('LANGUAGE')))
x |
Vector of character strings to search for |
extent |
Currently unused. an Extent object, or any object from which an Extent can be obtained. |
lang |
Language for place names in result. |
If the option
getOption('mapmiscCachePath')
is set, it will be used
to specify the folder to save downloaded
data. getOption('mapmiscVerbose')
for printing progress.
Data are retreived from Openstreetmap.org, see https://wiki.openstreetmap.org/wiki/Nominatim.
A SpatialPointsDataFrame
with coordinates in the
projection of extent
if possible, or long-lat
otherwise.
if(requireNamespace("rgdal", quietly = TRUE)) { cities=geocode('Ulan batar') mytiles = openmap(cities, buffer=800*1000, maxTiles=1) map.new(mytiles) plot(mytiles, add=TRUE) points(cities, col='red') text(cities, labels=cities$name, col='red',pos=4) }