R/srvGPSforReceiver.R

#' get the GPS fixes for a receiver from the data server
#'
#' These are the periodic GPS fixes from receivers belonging to the
#' project, and only makes sense for mobile receiver deployments.
#'
#' @param batchID integer scalar batch ID
#' @param ts real scalar processing timestamp of latest fix already owned
#' Default: 0, meaning none.
#'
#' @return data.frame with these columns:
#' \itemize{
#'    \item ts       numeric system timestamp
#'    \item gpsts    numeric GPS timestamp
#'    \item batchID  integer batch ID
#'    \item lat      numeric latitude in degrees N (negative is south)
#'    \item lon      numeric longitude in degrees E (negative is west)
#'    \item alt      numeric altitude in metres ASL
#' }
#'
#' @export
#'
#' @author John Brzustowski \email{jbrzusto@@REMOVE_THIS_PART_fastmail.fm}

srvGPSforReceiver = function(batchID, ts=0) {
    x = srvQuery(API=Motus$API_GPS_FOR_RECEIVER, params=list(batchID=batchID, ts=ts))
    return (structure(x, class = "data.frame", row.names=seq(along=x[[1]])))
}
jbrzusto/motusClient documentation built on May 30, 2019, 4:33 p.m.