Calculates the distance travelled (m), travel time (s), and speed (km/h)
between consecutive AIS positions for each vessel (mmsi).
Arguments
- ais_data
AIS data frame containing
timestamp,lon,lat, andmmsi.timestampmust be Unix time (seconds since 1970-01-01), whilelonandlatmust be numeric. Another vessel identifier may be used if the column is namedmmsi.- crs_meters
CRS (in metres) used to calculate distances. Defaults to EPSG:3035.
- nb_cores
Number of CPU cores used.
- outfile
File used to save logs.
Value
The input AIS data with the following additional columns:
time_travelled: Travel time (s) since the previous AIS position.distance_travelled: Distance travelled (m) since the previous AIS position.speed_kmh: Vessel speed (km/h).X,Y: coordinates incrs_meters.
Examples
if (FALSE) { # \dontrun{
library(AISanalyze)
data("ais")
ais <- ais %>%
dplyr::mutate(timestamp = as.numeric(lubridate::ymd_hms(datetime)))
out <- AIStravel(ais_data = ais)} # }