-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmts_getDistance.Rd
54 lines (47 loc) · 1.48 KB
/
mts_getDistance.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mts_getDistance.R
\name{mts_getDistance}
\alias{mts_getDistance}
\title{Calculate distances from \emph{mts} time series locations to a location of interest}
\usage{
mts_getDistance(
mts = NULL,
longitude = NULL,
latitude = NULL,
measure = c("geodesic", "haversine", "vincenty", "cheap")
)
}
\arguments{
\item{mts}{\emph{mts} object.}
\item{longitude}{Longitude of the location of interest.}
\item{latitude}{Latitude of the location of interest.}
\item{measure}{One of "geodesic", "haversine", "vincenty" or "cheap"}
}
\value{
Vector of of distances (meters) named by \code{deviceDeploymentID}.
}
\description{
This function uses the [geodist] package to return the distances (meters)
between \code{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.
}
\note{
The measure \code{"cheap"} may be used to speed things up depending on
the spatial scale being considered. Distances calculated with
\code{measure = "cheap"} will vary by a few meters compared with those
calculated using \code{measure = "geodesic"}.
}
\examples{
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]
}