Create a map of estimated locations as a static or dynamic map.
stk_map(
df,
bbox,
start_location,
roi,
dynamic = FALSE,
intervals = FALSE,
simplify = FALSE
)A data frame with locations produced with the skytrackr() function
A geographic bounding box provided as a vector with the format xmin, ymin, xmax, ymax.
A start location as lat/lon to indicate the starting position of the track (optional)
A region of interest under consideration, only used in plots during optimization
Option to create a dynamic interactive graph rather than a static plot. Both the path as the locations are shown. The size of the points is proportional to the latitudinal uncertainty, while equinox windows are marked with red points. (default = FALSE)
show the uncertainty intervals as shaded ellipses (default = FALSE)
simplify the plot and only show the map (default = FALSE)
A ggplot map of tracked locations or mapview dynamic overview.
# \donttest{
# define land mask with a bounding box
# and an off-shore buffer (in km), in addition
# you can specify the resolution of the resulting raster
mask <- stk_mask(
bbox = c(-20, -40, 60, 60), #xmin, ymin, xmax, ymax
buffer = 150, # in km
resolution = 0.5 # map grid in degrees
)
# define a step selection distribution/function
ssf <- function(x, shape = 0.9, scale = 100, tolerance = 1500){
norm <- sum(stats::dgamma(1:tolerance, shape = shape, scale = scale))
prob <- stats::dgamma(x, shape = shape, scale = scale) / norm
}
# estimate locations
locations <- cc876 |> skytrackr(
plot = TRUE,
mask = mask,
step_selection = ssf,
start_location = c(50, 4),
control = list(
sampler = 'DEzs',
settings = list(
iterations = 10, # change iterations
message = FALSE
)
)
)
#>
#> ══ Estimating locations ══════════════════════════════════════ skytrackr v2.0 ══
#>
#> ℹ Processing logger: CC876!
#>
#> ── Filtering data ──────────────────────────────────────────────────────────────
#>
#> ℹ (preview plot will update every 4 days)
#> ⠙ Estimating positions ■■■■ 10% | ETA: 20s
#> ⠹ Estimating positions ■■■■■■■■ 23% | ETA: 15s
#> ⠸ Estimating positions ■■■■■■■■■■■■■■■ 47% | ETA: 8s
#> ⠼ Estimating positions ■■■■■■■■■■■■■■■■■■■■ 63% | ETA: 7s
#> ⠴ Estimating positions ■■■■■■■■■■■■■■■■■■■■■■■■ 77% | ETA: 4s
#> ⠦ Estimating positions ■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 90% | ETA: 2s
#> ⠦ Estimating positions ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s
#> ℹ Data processing done ...
#----- actual plotting routines ----
# static plot, with required bounding box
locations |> stk_map()
#> → No bounding box (bbox) provided.
#> Bounding box is estimated from the data.
# }