MazamaLocationUtils (version 0.1.6)

table_addLocation: Add new known location records to a table

Description

Incoming longitude and latitude values are compared against the incoming locationTbl to see if the are already within radius meters of an existing entry. A new record is created for each location that is not already found in locationTbl.

Usage

table_addLocation(locationTbl = NULL, longitude = NULL,
  latitude = NULL, radius = NULL, stateDataset = "NaturalEarthAdm1",
  verbose = TRUE)

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

stateDataset

Name of spatial dataset to use for determining state codes, Default: 'NaturalEarthAdm1'

verbose

Logical controlling the generation of progress messages.

Value

Updated tibble of known locations.

See Also

table_addSingleLocation

table_removeRecord

table_updateSingleRecord

Examples

Run this code
# NOT RUN {
# Set up standard directories and spatial data
spatialDataDir <- tempdir() # typically "~/Data/Spatial"
mazama_initialize(spatialDataDir)

locationTbl <- get(data("wa_monitors_500"))

# Coulee City, WA
lon <- -119.290904
lat <- 47.611942

locationTbl <- 
  locationTbl %>%
  table_addLocation(lon, lat, radius = 500)
# }

Run the code above in your browser using DataLab