MazamaSpatialUtils (version 0.6.4)

getCountryName: Return country names at specified locations

Description

Uses spatial comparison to determine which country polygons the locations fall into and returns the country name for those polygons.

If allData = TRUE, additional data is returned.

Usage

getCountryName(lon, lat, dataset = "SimpleCountriesEEZ",
  countryCodes = NULL, allData = FALSE, useBuffering = FALSE)

Arguments

lon

vector of longitudes in decimal degrees

lat

vector of latitudes in decimal degrees

dataset

name of spatial dataset to use

countryCodes

vector of countryCodes

allData

logical specifying whether a full dataframe should be returned

useBuffering

logical flag specifying the use of location buffering to find the nearest polygon if no target polygon is found

Value

Vector of country names in English.

References

http://www.naturalearthdata.com/downloads/10m-cultural-vectors/

See Also

SimpleCountries

getSpatialData

Examples

Run this code
# NOT RUN {
lon <- seq(0, 50)
lat <- seq(0, 50)
getCountryName(lon, lat)
# }

Run the code above in your browser using DataLab