Skip to contents

this function can be used to obtain data from a local or remote SQLite database. If the full path with filename is provided in 'SQLiteDB', it will look for that SQLite-file locally. If 'SQLiteDB' is NULL it will establish a connection with a remote server. There is also functionality to use an existing opened data base connection that can be provided in 'use_connection'. For instance, when creating residence patches within a loop of tags and tide ID's. Because establishing a conncection within a for-loop takes a long time, an established connection can be used.

Usage

atl_get_data(
  tag,
  tracking_time_start,
  tracking_time_end,
  timezone = "CET",
  database = "some_database",
  host = "some.host.nl",
  username = "someuser",
  password = "somepassword",
  SQLiteDB = NULL,
  use_connection = NULL
)

Arguments

tag

An number representing the WATLAS tag (either in short format e.g. 4 digits or long format with 11 digits). May be passed as a character or a numeric, and will be converted to a character. For example "31001000001".

tracking_time_start

Character representation of time from which start-point data should be retrieved.

tracking_time_end

Character time representing the end point corresponding to the above start point.

timezone

Timezone of tracking_time_start and tracking_time_end. Must be a valid timezone for the as.POSIXct function.

database

The database name on the host server.

host

The server address on which the data are stored.

username

Username to access the server.

password

Password to access the server.

SQLiteDB

The full path including the filename of a local SQLite-database whith tracking data. This argument overrules establishing a connection with the remote host.

use_connection

An R-object with a previously established connection, for instance generated by RMySQL::dbConnect(RMySQL::MySQL(), user = 'username', password = 'password', dbname = 'database', host = 'host'). This argument overrules making a connection to a local host SQLiteDB or a remote host.

Value

A data.table of localizations of the specified tag, filtered between the start and end times.
posID = Unique number for localizations
tag = 4 digit tag number (character)
time = UNIX time (seconds)
datetime = Timestamp in POSIXct (UTC)
x = x-ccordinates in meters (UTM 31 N)
y = y-ccordinates in meters (UTM 31 N)
nbs = Number of Base Stations used in calculating coordinates
varx = Variance in estimating x-coordinates
vary = Variance in estimating y-coordinates
covxy = Co-variance between y- and y-coordinates

Author

Pratik R. Gupte & Allert I. Bijleveld & Johannes Krietsch