Skip to contents

Downloads and sets up the HWSD v2.0 data files required to extract soil data offline. The function retrieves the HWSD raster soil unit map and the SQLite database containing soil attributes. If the files already exist in the specified directory, they are used directly. The function returns an object with the raster and SQLite connection for further queries.

Usage

ini_hwsd2(data_path = "./data/", timeout = 300)

Arguments

data_path

String specifying the directory path where HWSD v2.0 data files are stored or should be downloaded (default is './data/').

timeout

Timeout in seconds for downloading each HWSD v2.0 data file (default is 300).

Value

A list object (`con`) containing two items: - `raster`: HWSDv2 raster object for spatial queries. - `sqlite`: Connection to the HWSDv2 SQLite database.

See also

Author

Khaled Al-Shamaa, k.el-shamaa@cgiar.org

Examples

if (interactive()) {
  hwsd2 <- ini_hwsd2(data_path = 'C:/Users/Kel-shamaa/Downloads/HWSD v2/')
}