diff --git a/src/crop/farmplot.jl b/src/crop/farmplot.jl index 49a100d01ff393fb1e142c8b9c2d61284d4e5d11..018ec54356b62fbe5972a34de2dbf65024d8c755 100644 --- a/src/crop/farmplot.jl +++ b/src/crop/farmplot.jl @@ -59,6 +59,17 @@ Return the height of the crop at this position, or nothing if there is no crop h (utility wrapper). """ function cropheight(pos::Tuple{Int64,Int64}, model::SimulationModel) - ismissing(model.landscape[pos...].fieldid) ? nothing : + ismissing(model.landscape[pos...].fieldid) ? 0.0cm : # TODO: 0.0cm correct here? cropheight(model.farmplots[model.landscape[pos...].fieldid]) end + +""" + cropcover(model, position) + +Return the crop cover of the crop at this position, or nothing if +there is no crop here (utility wrapper). +""" +function cropcover(pos::Tuple{Int64,Int64}, model::SimulationModel) + ismissing(model.landscape[pos...].fieldid) ? 0.0 : # TODO: 0.0 correct here? + cropcover(model.farmplots[model.landscape[pos...].fieldid]) +end