Skip to contents

Extract soil data from gssurgo

Usage

extract_soil_gssurgo(
  outdir,
  lat,
  lon,
  size = 1,
  grid_size = 3,
  grid_spacing = 100,
  depths = c(0.15, 0.3, 0.6)
)

Arguments

outdir

Output directory for writing down the netcdf file

lat

Latitude of center point (single numeric value)

lon

Longitude of center point (single numeric value)

size

Ensemble size

grid_size

Size of the spatial sampling grid around the center point (default: 3)

grid_spacing

Spacing between grid cells in meters (default: 100)

depths

Standard set of soil depths in m to create the ensemble of soil profiles with.

Value

It returns the address for the generated soil netcdf file

Details

This function takes a single lat/lon point and creates a spatial grid around it for sampling soil variability. The grid_size parameter determines how many grid points (grid_size x grid_size) are created around the center point.

Current Limitations

- MUKEY frequency weighting treats occurrence counts as proportional to area coverage - This approximation may introduce geometric bias for irregular polygon data - Buffer radius is set to grid_spacing/2 to reduce overlapping queries, but may still miss coverage - True area-weighted aggregation using polygon geometries is planned (see issue #3609)

Author

Hamze Dokoohaki, Akash

Examples

if (FALSE) { # \dontrun{
   outdir  <- "~/paleon/envTest"
   lat     <- 40
   lon     <- -80
   PEcAn.data.land::extract_soil_gssurgo(outdir, lat, lon)
} # }