View source: R/table_filterByDistance.R
table_filterByDistance | R Documentation |
Returns a tibble of the known locations from locationTbl
that are within distanceThreshold
meters of the target location
specified by longitude
and latitude
.
table_filterByDistance(
locationTbl = NULL,
longitude = NULL,
latitude = NULL,
distanceThreshold = NULL,
measure = c("geodesic", "haversine", "vincenty", "cheap")
)
locationTbl |
Tibble of known locations. |
longitude |
Target longitude in decimal degrees E. |
latitude |
Target latitude in decimal degrees N. |
distanceThreshold |
Distance in meters. |
measure |
One of "haversine" "vincenty", "geodesic", or "cheap" specifying desired method of geodesic distance calculation. |
Tibble of known locations.
Only a single target location is allowed.
library(MazamaLocationUtils)
locationTbl <- get(data("wa_monitors_500"))
# Too small a distanceThreshold will not find a match
locationTbl %>%
table_filterByDistance(
longitude = -117.3647,
latitude = 47.6725,
distanceThreshold = 10
) %>%
dplyr::glimpse()
# Expanding the distanceThreshold will find several
locationTbl %>%
table_filterByDistance(
longitude = -117.3647,
latitude = 47.6725,
distanceThreshold = 10000
) %>%
dplyr::glimpse()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.