Skip to contents

Internal helper used by benchmark_lucas_2018. For each requested property, calls lookup_fn (default lookup_soilgrids) at soilgrids_depth, converts to the soilKey unit and writes onto the pedon's horizon horizon_idx via add_measurement(..., source = "inferred_prior"). Synthesises the horizon if it does not exist yet (geometry from horizon_top_cm / horizon_bottom_cm).

Usage

.fill_horizon_from_soilgrids(
  pedon,
  horizon_idx,
  properties,
  soilgrids_depth = "0-5cm",
  horizon_top_cm = 0,
  horizon_bottom_cm = 20,
  horizon_designation = "Ap",
  lookup_fn = lookup_soilgrids
)

Details

Test injection: pass lookup_fn = function(...) value to bypass the network when unit-testing.