R/coordinate_conversion.R

Defines functions WGS84 RT90 sweref99 epsg

Documented in epsg RT90 sweref99 WGS84

##' epsg
##'
##' The epsg of various crs
##'
##' @return numeric value
##' @param x A character
##' @param ... other arguements
epsg <- function(x = c("sweref99", "RT90", "WGS84")) {
    x <- match.arg(x)
    switch(x,
           sweref99 = return(3006),
           RT90 = return(3021),
           WGS84 = return(4326))
}

##' sweref99
##'
##' The proj4str of sweref99
##'
##' @export
##' @return a string
sweref99 <- function() {
    paste0("+init=epsg:", epsg("sweref99"))
}

##' RT90
##'
##' The proj4str of RT90
##'
##' @export
##' @return a string
RT90 <- function() {
    paste0("+init=epsg:", epsg("RT90"))
}

##' WGS84
##'
##' The proj4str of WGS84
##'
##' @export
##' @return a string
WGS84 <- function() {
    paste0("+init=epsg:", epsg("WGS84"))
}
SVA-SE/svamap documentation built on Sept. 25, 2020, 3:53 p.m.