Dear Tomislav,
I am trying to relate incomes of 8000 poor rural households in 350 villages in the tropics to soil data. I have the coordinates for the villages in csv format and would like to extract soil properties from the ISRIC 1km soil grid for each location in R. I have used the extract function with netcdf files before but I have difficulties to use it with the soil data. Could you please help me with an approach to extract soil properties for each village location in a 10km radius?
Cheers--
You received this message because you are subscribed to the Google Groups "Global Soil Information" group.
To unsubscribe from this group and stop receiving emails from it, send an email to global-soil-infor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dear Tom and Jorge,
Thanks a lot for your answers! I tried
village=data.frame(GEO[,c("gvillcode","Long.dec.deg","Lat.dec.deg")])
names(village)=c("id","lon","lat")
coordinates(village)= ~lon+lat
proj4string(village) = CRS("+proj=longlat +datum=WGS84")
soil=REST.SoilGrids(c("ORCDRC","PHIHOX","SNDPPT","SLTPPT","CLYPPT","GRAVOL","CEC","DBR"))
soil_village=over(soil, village)
where GEO is the file with my village coordinates in decimal degrees. I think, I have now matched the village coordinates with the soil data of that specific grid. However, since I believe that the fields of the households for agricultural production are mainly located outside this grid I would like to use a buffer. My villages are in 20 tropical countries. How can I use the proposed code for an area defined by coordinates and not countries?
> wg.url <- url("http://gsif.isric.org/lib/exe/fetch.php?media=admin.af.rda")
> load(wg.url)
> proj4string(admin.af) <- "+proj=longlat +datum=WGS84"
> country.af <- as(admin.af, "SpatialLines")
> ghana <- admin.af[admin.af$FORMAL_EN=="Republic of Ghana",]
Cheers
Frederik
--
You received this message because you are subscribed to a topic in the Google Groups "Global Soil Information" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/global-soil-information/HwzLwTbtTv4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to global-soil-infor...@googlegroups.com.