TransWikia.com

Get data from SoilGrid

Geographic Information Systems Asked by Andriy Hertz on March 19, 2021

I used to get data by using the code shared below. Now it doesn’t work anymore (The variable ov contains only data lat and lon). What could be the reason?

library(RCurl)
library(GSIF)
library(rjson)
library(sp)
# a20-a40
pnts <- data.frame(lon=c(25.622718,24.8909885,25.1746257,25.7687652,25.8114637,
                         25.0144102,25.1716947,24.5235939,26.0909422,25.5048733,
                         24.7604685,26.0271247,25.9000033,26.1660861,25.99764,
                         24.9656369,25.1614127,24.8309249), 
                   lat=c(49.3927099,49.8062357,48.9379293,49.1874657,48.8531533,
                         49.0615922,49.5889481,49.5390535,49.2039047,49.5594162,
                         49.3564161,49.3786846,49.2095662,49.0764702,49.1567037,
                         49.2480082,49.6369746,50.217551), 
                   id=c("p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11",
                        "p12","p13","p14","p15","p16","p17","p18"))

coordinates(pnts) <- ~lon+lat
proj4string(pnts) <- CRS("+proj=longlat +datum=WGS84")
pnts
soilgrids.r <- REST.SoilGrids(c("TAXNWRB","CECSOL","ORCDRC","PHIHOX","PHIKCL", "WWP",
                                "OCSTHA","BLDFIE","CLYPPT","CRFVOL","SLTPPT","SNDPPT"))
ov <- over(soilgrids.r, pnts)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP