Skip to contents

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

Usage

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 = "MCO",
                    release = 'gbOpen',
                    path_output = tempdir())

get_admin_data(lon = c(7.416, 7.434),
               lat = c(43.734, 43.747),
               path_admin_data = file.path(tempdir(), 'MCO_admin_levels.shp'))

}