Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/distance-fields.R
Calculate the distances between a specified target location and all grid
points of a given "pField"
. The calculation is based on the function
distGeo
.
1 2 3 4 5 6 7 8 9 | GetDistanceField(
field,
latlon.field = NULL,
lat,
lon,
get.nearest = FALSE,
index = NULL,
verbose = FALSE
)
|
field |
a |
latlon.field |
the optional result of calling
|
lat |
numeric vector of length 1 with the latitude of the target location relative to which distances are to be calculated. |
lon |
numeric vector of length 1 with the longitude of the target location. |
get.nearest |
logical to specify whether the given latitude - longitude
pair shall be used *as is* as the target location ( |
index |
an integer array index of the input |
verbose |
logical; if |
latlon.field
can be supplied for efficiency if
GetDistanceField
needs to be called many times, e.g., to calculate
the distances from several target locations for the same coordinate field.
Numeric vector with distances in km of the grid points of
"field"
relative to the target location following the spatial
ordering of a "pField"
object.
Thomas Münch
1 2 3 4 5 6 7 8 9 10 11 | field <- pField(lat = seq(0, 90, 10), lon = c(-10, 0, 10))
d <- GetDistanceField(field, lat = 5, lon = 5, verbose = TRUE)
range(d)
d <- GetDistanceField(field, lat = 5, lon = 5,
get.nearest = TRUE, verbose = TRUE)
range(d)
d <- GetDistanceField(field, index = 1, verbose = TRUE)
range(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.