femiguez / apsimx

R package for APSIM-X
https://femiguez.github.io/apsimx-docs/
45 stars 19 forks source link

Issues with the get_isric_soil_profile() command #134

Closed Janewanguimugo closed 9 months ago

Janewanguimugo commented 9 months ago

I am trying to download soil data but it comes without the sorghum soil parameterized. How can I edit this code so that my soil has Sorghum? sorghum.zip

Get soil

x <- 29.7 y<- -20.9 crop<- "sorghum.apsimx" soil <- get_isric_soil_profile(lonlat = c(x,y))

Replace soil profile

swat <- soilwat_parms()

We need to add the crop names

soil$crops <- c("Sorghum", "Maize")

edit_apsimx_replace_soil_profile(crop, root = c("pd", "Base_one"), soil.profile = soil, overwrite = TRUE)

femiguez commented 9 months ago

@Janewanguimugo I will work on this as soon as I can so that you can provide the 'crops' as an argument to the 'get_isric_soil_profile' function. Thanks for the report

femiguez commented 9 months ago

@Janewanguimugo I added an argument to get_isric_soil_profile, which allows for the addition of crops. The call would be:

sp1 <- get_isric_soil_profile(lonlat = c(-93, 42), add.args = list(crops = c("Maize", "Sorghum")))

However, I can't test this now because the soilgrids REST API is down

Janewanguimugo commented 9 months ago

It works perfectly! Thank you

On Mon, 25 Sept 2023 at 14:43, Fernando Miguez @.***> wrote:

@Janewanguimugo https://github.com/Janewanguimugo I added an argument to get_isric_soil_profile, which allows for the addition of crops. The call would be:

sp1 <- get_isric_soil_profile(lonlat = c(-93, 42), add.args = list(crops = c("Maize", "Sorghum")))

However, I can't test this now because the soilgrids REST API is down

— Reply to this email directly, view it on GitHub https://github.com/femiguez/apsimx/issues/134#issuecomment-1733500884, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYYCGN2YD5L7AQW5ZRGBVATX4FU6ZANCNFSM6AAAAAA5BGN7XQ . You are receiving this because you were mentioned.Message ID: @.***>