Jump to: navigation, search

WPS

Revision as of 16:03, 26 April 2013 by Ritmarewiki (Talk | contribs)

<ref name="wps">WPS</ref>

The OpenGIS® Web Processing Service (WPS) Interface Standard provides rules for standardizing how inputs and outputs (requests and responses) for geospatial processing services, such as polygon overlay. The standard also defines how a client can request the execution of a process, and how the output from the process is handled. It defines an interface that facilitates the publishing of geospatial processes and clients’ discovery of and binding to those processes. The data required by the WPS can be delivered across a network or they can be available at the server.

Installation WPS service from 52°North

  • Download the latest 52°North [WPS release from here.(If you want the source code, follow this tutorial)
  • Rename the downloaded .war file to wps.war and drop it in the webapps folder of your tomcat.

Configure R

  • Start R, install the package Rserve and the recommended ones with the following command. Add more of them for your own purposes:
install.packages(c("Rserve","sp","maptools","rgdal", "spatstat","gstat","automap"))

Optional

You can use the Rprofile.site file in directory R_HOME%/etc to configure options and packages that should be available on every start of R. To do this, initialize the .First function. Specify required libraries and the default work directory inside the function. These settings will be preloaded during start-up of R:

.First = function() {
#the following libraries will be loaded on R start-up:
library(sp)
library(gstat)
library(rgdal)
library(spatstat)
library(maptools)
library(automap)
#specify the R work directory here:
setwd("<R WD>") # change it!!
}

Configure Rserve

You can start Rserve from within R on your local machine by the following commands:

library(Rserve)
Rserve()

In that case you have to pass that parameter in the args argument such as:

Rserve(args="--no-save")

However, Rserve is a stand-alone program, so it can be started directly as well. If you installed Rserve from a source package (on unix), type:

R CMD Rserve

Depending on the purpose and libraries on your computer you may want to add --gui-none or --no-save (see R documentation). Rserve passes any parameters to the underlying R engine except for Rserver-related parameters. After initialization Rserve daemonizes itself to work as a server. It can be shut down gracefully (i.e. it will wait until all existing connections are finished) if it recieves shutdown command from an authorized connection. It terminates not so gracefully if it receives usual termination signals.If no config file is supplied, Rserve accepts no remote connections, requires no authentication and file transfer is enabled. For more details about how to configure Rserve, see here.

Command line arguments

Starting with Rserve 0.1-9 special command line arguments are supported in addition to the config file. Normally Rserve passes all arguments to R, but several special ones are processed and removed from the list before initializing R. Those parameters override any settings specified in the config file.

  • --RS-port port Rserve will listen on the specified TCP port.
  • --RS-socket socket use the specified local unix socket instead of TCP/IP.
  • --RS-workdir path set working directory root for connections to the specified path.
  • --RS-conf file load the specified config file (the default config file is still loaded, but its settings have lower priority).
  • --RS-dumplimit n (debug version of Rserve only) specifies the number of values to print when dumping content of packages or SEXPs (default is 128).
  • --RS-settings print current settings of the Rserve. Useful to check the current configuration.
  • --RS-encoding encoding set default string encoding to the given value
  • --help prints a brief help screen and exits (R is not started)
  • --version prints version of Rserve.

This argument is retained in the list and processed by R as well.In order to list all currently supported arguments, type:

R CMD Rserve --help


==References==Template:Reflist