View source: R/mts_getDistance.R
mts_getDistance | R Documentation |
This function uses the [geodist] package to return the distances (meters)
between mts
locations
and a location of interest. These distances can be used to create a
mask identifying monitors within a certain radius of the location of interest.
mts_getDistance(
mts = NULL,
longitude = NULL,
latitude = NULL,
measure = c("geodesic", "haversine", "vincenty", "cheap")
)
mts |
mts object. |
longitude |
Longitude of the location of interest. |
latitude |
Latitude of the location of interest. |
measure |
One of "geodesic", "haversine", "vincenty" or "cheap" |
Vector of of distances (meters) named by deviceDeploymentID
.
The measure "cheap"
may be used to speed things up depending on
the spatial scale being considered. Distances calculated with
measure = "cheap"
will vary by a few meters compared with those
calculated using measure = "geodesic"
.
library(MazamaTimeSeries)
# Garfield Medical Center in LA
longitude <- -118.12321
latitude <- 34.06775
distances <- mts_getDistance(
mts = example_mts,
longitude = longitude,
latitude = latitude
)
# Which sensors are within 1000 meters of Garfield Med Ctr?
distances[distances <= 1000]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.