addPgGps: Add GPS to a Pamguard Database

View source: R/addPgGps.R

addPgGpsR Documentation

Add GPS to a Pamguard Database

Description

Add GPS data to an existing Pamguard database

Usage

addPgGps(
  db,
  gps,
  source = c("csv", "SPOTcsv", "SPOTgpx"),
  format = c("%m/%d/%Y %H:%M:%S", "%m-%d-%Y %H:%M:%S",
    "%Y/%m/%d %H:%M:%S", "%Y-%m-%d %H:%M:%S"),
  tz = "UTC"
)

Arguments

db

database file to add gps data to

gps

data.frame of gps data or a character of the file name to be read. If a data.frame or non-SPOT csv file, needs columns UTC, Latitude, and Longitude. If multiple separate tracks are present in the same dataset, this should be marked with a column labeled Name

source

one of SPOTcsv, SPOTgpx, or csv. Describes the source of the GPS data, not needed if gps is a data.frame

format

date format for converting to POSIXct, only needed for source='csv'. See strptime

tz

timezone of gps source being added, will be converted to UTC

Value

Adds to the database db, invisibly returns the Name of the GPS track if successful (NA if not named)

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples

## Not run: 
# not run because example files don't exist
myDb <- 'PamguardDatabase.sqlite3'
# adding from a .gpx file downloaded from SPOT
spotGpx <- 'SpotGPX.gpx'
addPgGps(myDb, spotGpx, source='SPOTgpx')
# adding from a csv file with a Y-M-D H:M date format
gpsCsv <- 'GPS.csv'
addPgGps(myDb, gpsCsv, source='csv', format='%Y-%m-%d %H:%M')

## End(Not run)


PAMmisc documentation built on Aug. 17, 2023, 1:06 a.m.