Learn R Programming

PAMscapes (version 0.11.3)

downloadMarCadAIS: Download AIS Data from Marine Cadastre

Description

Downloads daily AIS files from https://hub.marinecadastre.gov/pages/vesseltraffic covering the date range present in input data

Usage

downloadMarCadAIS(x, outDir, overwrite = FALSE, unzip = TRUE, verbose = TRUE)

Value

a vector of the paths to the downloaded .zip files, any days that were unable to download will be NA

Arguments

x

a dataframe with column UTC in POSIXct format

outDir

directory to save the downloaded files

overwrite

logical flag to overwrite existing data. Recommended to be FALSE to avoid re-downloading large files unnecessarily

unzip

logical flag to unzip downloaded files. Original downloads from Marine Cadastre come as large .zip

verbose

logical flag to print messages about download progress

Author

Taiki Sakai taiki.sakai@noaa.gov

Examples

Run this code
gps <- data.frame(Latitude=c(33.2, 33.5,33.6),
                  Longitude=c(-118.1, -118.4, -119),
                  UTC=as.POSIXct(
                    c('2022-04-28 05:00:00',
                      '2022-04-28 10:00:00',
                      '2022-04-28 20:00:00'),
                    tz='UTC'))
tempDir <- tempdir()
# Commented out because running this will download
# a ~500mb file
# marcadFiles <- downloadMarCadAIS(gps, outDir=tempDir)

Run the code above in your browser using DataLab