R/check_aoi.R

Defines functions check_aoi

Documented in check_aoi

#' Check if aoi is an sf or sp type object
#' If sp, convert to sf and return
#' @param aoi the area of interest object
#' @import sf
#' @NoRd
check_aoi <- function(aoi) {
  if (is(aoi, 'SpatialPolygonsDataFrame')){
    suppressWarnings(aoi <- st_as_sf(aoi))
  } else{
    return(aoi)
  }
}

Try the gfcanalysis package in your browser

Any scripts or data that you put into this service are public.

gfcanalysis documentation built on Oct. 11, 2023, 5:15 p.m.