getVariable: Return SFDF variable at specified locations

View source: R/getVariable.R

getVariableR Documentation

Return SFDF variable at specified locations

Description

Uses spatial comparison to determine which polygons the locations fall into and returns the variable associated with those polygons.

If allData = TRUE, the entire dataframe is returned.

Usage

getVariable(
  longitude = NULL,
  latitude = NULL,
  dataset = NULL,
  variable = NULL,
  countryCodes = NULL,
  allData = FALSE,
  useBuffering = FALSE
)

Arguments

longitude

Vector of longitudes in decimal degrees East.

latitude

Vector of latitudes in decimal degrees North.

dataset

Name of spatial dataset to use.

variable

Name of dataframe column to be returned.

countryCodes

Vector of ISO 3166-1 alpha-2 country codes.

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 or dataframe.

See Also

getSpatialData


MazamaSpatialUtils documentation built on Sept. 8, 2023, 5:22 p.m.