R/pkg-sf.R

Defines functions as_proj.crs st_crs.rproj_proj

# dynamically exported
st_crs.rproj_proj <- function(x, ...) {
  sf::st_crs(proj_make_compact_definition(x))
}

#' @export
as_proj.crs <- function(x, ...) {
  if (isTRUE(is.na(x$epsg))) {
    proj_create(x$input)
  } else {
    proj_create(paste0("EPSG:", x$epsg))
  }
}
paleolimbot/rlibproj documentation built on Jan. 21, 2022, 1:03 p.m.