extract_condem: Extract a subset of a Raster object.

View source: R/extract-elevation.R

extract_condemR Documentation

Extract a subset of a Raster object.

Description

Extract (crop and mask) a geographic subset of a Raster object.

Usage

extract_condem(condem = rawdem_br, poly_station, dis.buf = 0)

Arguments

condem

character, path file of hydrologically conditioned elevation model (CON) from Hydrosheds data set. Default: raster("~/Dropbox/datasets/GIS/hydrosheds/sa_con_3s_hydrosheds.grd").

poly_station

a sf polygon or a raster extent, Default: extract_poly(station = 74).

dis.buf

scalar numeric.

Details

This function was created with the intention of use to create the input NETCDF file for the FUSE model, elevation_bands.nc. The function for processing of hydrosheds CON raster is available at data-raw/con-hydrosheds.R. The resulting CON raster for South America (sa_con_3s_hydrosheds.gr*, spatial resolution of ~90 m) can be downloaded here.

Value

Raster object.

Note

The CON raster file is not distributed with the package due to its huge size (12.5 GB).

See Also

prep_poly_posto, mask,crop

Examples

## Not run: 
if(FALSE){
  info_posto <- info_station(name_regex = "MUNHOZ")
  poly_posto <- extract_poly(station = info_posto$posto)
  rawdem_br <- raster(
    system.file("extdata", "BRA_msk_alt.grd", package = "HEgis")
  )
  con_posto <- extract_condem(
   rawdem_br,
   poly_posto,
   dis.buf = 0
  )
  con_posto
}

## End(Not run)

lhmet-ped/HEgis documentation built on July 23, 2022, 2:59 a.m.