MazamaLocationUtils (version 0.1.6)

table_getNearestLocation: Return known locations

Description

Returns a tibble of known locations from locationTbl, one for each incoming location. If no known location is found for a particular incoming location, that record in the tibble will contain all NA.

Usage

table_getNearestLocation(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

Tibble of known locations.

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_getNearestLocation(locationTbl, lon, lat, radius = 50) %>% str()

# Expanding the radius will find one
table_getNearestLocation(locationTbl, lon, lat, radius = 5000) %>% str()
# }

Run the code above in your browser using DataLab