This repo contains R code for downloading soils data from SSURGO database and converting it into APSIM format. All the code is wrapped in a easy-to-use shiny app. Run the app.R
file using R studio, add the needed inputs and click on the "download SSURGO" button.
Note that data from SSURGO at field scale is essentially unreliable and should be used with caution when setting up the APSIM model. Rather, SSURGO data should be used as "starting-point" and verified against field measurements when available.
The code behind the tool relies heavily on the FedData package. APSIM parameter set estimation follows the approach described by Archontoulis et al. (2014, Agron. J. 106(3):1025-1040).
Before using this tool, make sure you have installed the following packages:
install.packages(c("shiny","leaflet","shinythemes","FedData","maps",
"maptools","rgdal","raster","dplyr","ggplot2","XML",
"Hmisc","lubridate"))
- Site name: Unique name to label downloaded data
- Field extent: North and South as latitude, East and West as longitude.
- Soil layers: User-defined, in centimeters
- Crop(s) to be simulated: Needed for definition of soil-crop parameters (e.g. crop_LL, XF)
- Downloaded SSURGO spatial data files are saved into
.zip
files in a local subdirectory/RAW
- Extracted SSURGO tables are saved into a local subdirectory
/EXTRACTIONS/SITE_NAME
- APSIM-compatible file is saved as
SITE_NAME.xml
. This can be read in the APSIM UI using the toolbox option.
- Average across soil types: if
TRUE
, then returns only one soil, representing the weighted avergage across all soil types. IfFALSE
, returns all soils - Save soil map: if
TRUE
then.shp
and.jpg
files of the downloaded soils are saved in the working directory
- Questions about the code and methodology: Rafael Martinez-Feria, Dep. of Agronomy, Iowa State University
- Questions about methodology and collaborations: Sotirios Archontoulis, Dep. of Agronomy, Iowa State University