Learn R Programming

slga (version 1.1.1)

get_soils_data: Get SLGA soils data

Description

Downloads SLGA gridded soils data in raster format from public WCS services.

Usage

get_soils_data(
  product = NULL,
  attribute = NULL,
  component = "ALL",
  depth = NULL,
  aoi = NULL,
  write_out = FALSE,
  filedir
)

Arguments

product

Character, one of the options from column 'Short_Name' in slga_product_info, where Type = 'Soil'.

attribute

Character, one of the options from column 'Code' in slga_attribute_info.

component

Character, one of the following:

  • 'VAL' - predicted value surface.

  • 'CLO' - lower 95% confidence interval surface.

  • 'CHI' - upper 95% confidence interval surface.

  • 'CIS' - both confidence interval surfaces.

  • 'ALL' - value and both confidence interval surfaces.

Defaults to 'ALL'.

depth

Integer from 1 to 6. The numbers correspond to the following depth ranges:

  1. 0 to 5 cm.

  2. 5 to 15 cm.

  3. 15 to 30 cm.

  4. 30 to 60 cm.

  5. 60 to 100 cm.

  6. 100 to 200 cm.

aoi

Vector of WGS84 coordinates defining a rectangular area of interest. The vector may be specified directly in the order xmin, ymin, xmax, ymax, or the function can derive an aoi from the boundary of an `sf` or `raster` object.

write_out

Boolean, whether to write the retrieved dataset to disk. Defaults to FALSE.

filedir

directory in which to write files if write_out == TRUE.

Value

Raster stack or single raster, depending on the value of `component`.

Examples

Run this code
# NOT RUN {
# get surface clay data for central Brisbane
aoi <- c(152.95, -27.55, 153.07, -27.45)
bne_surface_clay <- get_soils_data(product = 'NAT', attribute = 'CLY',
                                   component = 'ALL', depth = 1,
                                   aoi = aoi, write_out = FALSE)

# get estimated clay by depth for central Brisbane
bne_all_clay <- lapply(seq.int(6), function(d) {
  get_soils_data(product = 'NAT', attribute = 'CLY',
                 component = 'VAL', depth = d,
                 aoi = aoi, write_out = FALSE)
})
bne_all_clay <- raster::brick(bne_all_clay)
# }

Run the code above in your browser using DataLab