REST.SoilGrids-class {GSIF}R Documentation

A class for SoilGrids REST API

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

## 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)

[Package GSIF version 0.5-5 Index]