vessel_grid: Interpolate vessel fixes and associate with grid cells

View source: R/vessel_grid.R

vessel_gridR Documentation

Interpolate vessel fixes and associate with grid cells

Description

This function determines each spatial grid cell intersected by each vessel transit. To do so, it interpolates position fixes to ensure that there is one at least every 0.5 km.

Usage

vessel_grid(grids, vessels, toplot = FALSE, verbose = TRUE)

Arguments

grids

A spatial grid of cells, as produced by shipstrike::make_grid() (see documentation) (or at least matching the format thereof).

vessels

A data.frame of position fixes, with the following columns (note that the output from shipstrike::simulate_vessel() meets these criteria):

  • vid = Unique vessel identifier (numeric)

  • type = Vessel type (character string)

  • speed = Vessel speed, in knots (numeric)

  • length = Vessel length, in meters (numeric)

  • width = Vessel beam width, in meters (numeric)

  • draft = Vessel beam width, in meters (numeric)

  • datetime = Datetime in UTC, with format ⁠yyyy-mm-dd hh:mm:ss⁠

  • x = Longitude, decimal degrees (Western degrees negative)

  • y = Latitude, decimal degrees (Southern degrees negative)

toplot

A Boolean; if TRUE, progress plots will be shown.

verbose

A Boolean; if TRUE, updates will be printed to the Console.

Value

A data.frame of interpolated vessel position fixes (can be quite large) and the grid cell id associated with each position fix.

Examples

data(grid_kfs)
data(ais_2019)
vessel_grid(grid_kfs, ais_2019)


ericmkeen/shipstrike documentation built on May 21, 2023, 7:05 a.m.