This function takes a set of longitude and latitude coordinates and retrieves the administrative units that each point lies within.

get_admin_data(lon, lat, path_admin_data)

Arguments

lon

A numeric vector giving the longitude of the sampling sites in Decimal Degrees.

lat

A numeric vector giving the latitude of the sampling sites in Decimal Degrees.

path_admin_data

The file path to the admin data. Note that the function expects .shp format output from the download_admin_data function or from another user supplied source.

Value

data.frame

Examples

if (FALSE) {

download_admin_data(iso3 = "BGD", path_output = getwd())

get_admin_data(lon = template_es_data$lon,
               lat = template_es_data$lat,
               path_admin_data = file.path(getwd(), 'BGD_admin_levels.shp'))

}