MazamaLocationUtils (version 0.1.6)

table_getLocationID: Return IDs of known locations

Description

Returns a vector of locationIDs for the known locations that each incoming location will be assigned to within the given. If more than one known location exists within the given radius, the closest will be assigned. NA will be returned for each incoming that cannot be assigend to a known location in locationTbl.

Usage

table_getLocationID(locationTbl = NULL, longitude = NULL,
  latitude = NULL, radius = NULL)

Arguments

locationTbl

Tibble of known locations, Default: NULL

longitude

Vector of longitudes in decimal degrees E, Default: NULL

latitude

Vector of latitudes in decimal degrees N, Default: NULL

radius

Radius in meters, Default: NULL

Value

Vector of known locationIDs.

Examples

Run this code
# NOT RUN {
locationTbl <- get(data("wa_monitors_500"))

# Wenatchee
lon <- -120.325278
lat <- 47.423333

# Too small a radius will not find a match
table_getLocationID(locationTbl, lon, lat, radius = 50)

# Expanding the radius will find one
table_getLocationID(locationTbl, lon, lat, radius = 5000)
# }

Run the code above in your browser using DataLab