Create a map of estimated locations as a static or dynamic map.
stk_map(df, bbox, start_location, roi, dynamic = 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)
A ggplot map of tracked locations or mapview dynamic overview.
if (FALSE) { # \dontrun{
#----- estimated locations on demo data ----
# 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 with default values
# and plot progress
locations <- cc876 |> skytrackr(plot = FALSE)
#----- actual plotting routines ----
# static plot, with required bounding box
locations |> stk_map(bbox = c(-20, -40, 60, 60))
# dynamic plot
locations |> stk_map(dynamic = TRUE)
} # }