REST.SoilGrids: A class for SoilGrids REST API

Description Slots Methods Note Author(s) References See Also Examples

Description

A class for SoilGrids REST API Service. Can be used to overlay points or fetch grid values from SoilGrids Soil Information System.

Slots

server:

object of class "character"; contains the location of the server that executes REST.SoilGrids calls

query:

object of class "list"; contains parameters or REST.SoilGrids query

stream:

object of class "character"; contains parameters or REST.SoilGrids stream operation

Methods

over

signature(x = "REST.SoilGrids", y = "SpatialPoints"): overlays spatial points and the target grids defined via the REST.SoilGrids-class (point-by-point) and returns list of objects of "SpatialPixelsDataFrame"-class

Note

More examples of overlay and download functions are available via http://rest.soilgrids.org/. over method is not recommended for large point data sets.

Author(s)

Tomislav Hengl & Jorge S. Mendes de Jesus

References

See Also

SoilGrids-class, WPS-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(rjson)
library(sp)
## 2 points:
pnts <- data.frame(lon=c(10.65,5.36), lat=c(51.81,51.48), id=c("p1","p2"))
coordinates(pnts) <- ~lon+lat
proj4string(pnts) <- CRS("+proj=longlat +datum=WGS84")
pnts
## REST example:
soilgrids.r <- REST.SoilGrids(c("ORCDRC","PHIHOX"))
ov <- over(soilgrids.r, pnts)
str(ov)

## End(Not run)

GSIF documentation built on May 2, 2019, 5:44 p.m.

Related to REST.SoilGrids in GSIF...