Learn R Programming

GSIF (version 0.5-5.1)

WPS-class: A class for a Web Processing Service

Description

A class for a Web Processing Service. Can be used to overlay points or fetch grid values for rasters located remotely on a server and specified via the inRastername slot.

Arguments

Slots

server:

object of class "list"; contains the location of the CGI script that executes WPS ("URI"); service name ("service.name"), version ("version"), request type ("request"), identifier ("identifier")

inRastername:

object of class "character"; name of the objects on the server

Methods

show

signature(object = "WPS"): gets the complete server capabilities

getProcess

signature(x = "WPS"): gets a list of processes available from a server

describe

signature(x = "WPS"): lists parameters specific to some service identifier

over

signature(x = "WPS", y = "SpatialPoints"): overlays spatial points and the target grids defined via the WPS-class (point-by-point)

subset

signature(x = "WPS"): subsets a grid (from server) and loads it to R; use bbox argument to specify the bounding box

References

See Also

landmask

Examples

Run this code
# NOT RUN {
library(XML)
library(sp)
URI = "http://wps.worldgrids.org/pywps.cgi"
server <- list(URI=URI, request="execute", 
    version="version=1.0.0", service.name="service=wps", 
    identifier="identifier=sampler_local1pt_nogml")
glcesa3.wps <- new("WPS", server=server, inRastername="glcesa3a")
# show(biocl15.wps)
prl <- getProcess(glcesa3.wps)
prl[7]
describe(glcesa3.wps, identifier="overlay")
p1 <- data.frame(lon=15, lat=15)
coordinates(p1) <- ~lon+lat
proj4string(p1) <- CRS("+proj=longlat +datum=WGS84")
p1
over(glcesa3.wps, p1)
# fetch grids and load the to R:
glcesa3 <- subset(glcesa3.wps, bbox=matrix(c(20,40,22,42), nrow=2))
image(glcesa3)
# }

Run the code above in your browser using DataLab