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

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`.

Note

  • An aoi larger than 1x1 decimal degree is retrieveable, but be aware that download file size will be large. If you want a dataset that covers more than ~3x3', it may be faster to download the full GeoTIFF from the CSIRO Data Access Portal and crop out your AOI using GDAL.

  • Output rasters are aligned to the parent dataset rather than the aoi. Further resampling may be required for some applications.

  • specify `depth = 1` for attributes 'DES' and 'DER' as they are whole-of-profile parameters.

Examples

# \donttest{ # 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) })
#> Assuming AOI coordinates are in EPSG:4283 and ordered correctly.
#> Assuming AOI coordinates are in EPSG:4283 and ordered correctly.
#> Assuming AOI coordinates are in EPSG:4283 and ordered correctly.
#> Assuming AOI coordinates are in EPSG:4283 and ordered correctly.
#> Assuming AOI coordinates are in EPSG:4283 and ordered correctly.
#> Assuming AOI coordinates are in EPSG:4283 and ordered correctly.
bne_all_clay <- raster::brick(bne_all_clay) # }