Learn R Programming

PAMmisc (version 1.12.4)

addPgGps: 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"
)

Value

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

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

Author

Taiki Sakai taiki.sakai@noaa.gov

Examples

Run this code
if (FALSE) {
# 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')
}

Run the code above in your browser using DataLab