R/30_gadm_removeBackground.R

Defines functions gadm_removeBackground.gadm_sp gadm_removeBackground.gadm_sf

# gadm_removeBackground.gadm_sf -------------------------------------------
# =========================================================================
gadm_removeBackground.gadm_sf <- function(x) {
  if (x$hasBGND == FALSE) {
    warning("Map has no background.")
    return(x)
  }
  
  x$hasBGND <- FALSE
  x$BGND    <- NULL
  
  x
}

# gadm_removeBackground.gadm_sp -------------------------------------------
# =========================================================================
gadm_removeBackground.gadm_sp <- function(x) {
  if (x$hasBGND == FALSE) {
    warning("Map has no background.")
    return(x)
  }
  
  x$hasBGND <- FALSE
  x$BGND    <- NULL
  
  x
}

Try the GADMTools package in your browser

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

GADMTools documentation built on Aug. 5, 2021, 1:06 a.m.