You are here: Wiki>Geostatistics Web>WPS4R>WPS4RforEO2Heaven (19 Mar 2013, DanielNuest)Edit Attach

Using WPS4R for EO2HEAVEN Use Case

Old Workflow

A WMS-Wrapper for a WPS that interacts with an SOS and R. The WPS calls an R Skript (more specifically a function in the script). Input parameters are station identifiers and measurement values. Before that an R workspace is loaded with the required function and data.



wmsConfig wmsConfig.xml

The config file for the WMS wrapper. The only thing happening here is the replacement of the timestamp ( $wms:time$) and then the WMS calls the WPS.

The WPS algorithm reading SOS data (station identifiers, measurement values) and then calls the R script. The result of the R script is a GeoTIFF which is saved into the R workspace and then read in Java. This is currently very combersome because no geodata can directly be transferred between Java and R except using files.
  • The data transfer problem will not be solved any time soon... but could be wrapped better, maybe. -- DanielNuest - 2013-01-17
R Script and workspace AirQualityMapping.r AirQualityMapping.RData

The complete script needs more data, but the workspace already contains the required variables. The function function.getPollutantConentrationAsGeoTiff is called by the WPS and takes the following inputs: a) a vector with station IDs, b) the corresponding measurement values, c) the pollutant, and d) the name of the output GeoTIFF.

Suggested Application of WPS4R

All SOS interaction is transferred into the R script, so the former input data vector with actual measurements is not needed anymore.

  • vector with station identifiers
  • time
    • ISO8601 format, e.g. 2007-12-31T00:00:00.000+0100 (important: time zone explicitly needed)
  • observed property
  • sos URL
    • suggested default:
  • offering (= pollutant)
  • .Rdata file with the functions and list.weights.

Annotated Script and Request Example



Description: http://localhost:8080/wps/WebProcessingService?Request=DescribeProcess&service=WPS&identifier=org.n52.wps.server.r.eo2h_airqualitysaxony

Description file: processDescription.xml

Resources (preloaded by WPS): http://localhost:8080/wps/R/resources/EO2H/AirQualityMapping.RData

How to run

  • Set up R, Rserve and WPS
  • Go to WPS admin console, activate the "LocalRAlgorithmRepository"
  • Go to built-in WPS test client, Run the execute request "R_EO2H_AirQualitySaxony.xml" (its within the example requests selection)
  • Download the file, add file extension ".tiff" to the filname


  • %ICON{unchecked} SOS Daten-Download einbauen

Current Problems

  • Line 68 was commented out because it causes errors, but the script seems to run without fail though:
    #FIXME 'eventTime' does not compute, errormessage:
    # Error in sosCreateTime(sos = sos, time = in_time, operator = "TM_Equals") :
    # object '.l' not found
    #eventTime <- sosCreateTime(sos = sos, time = in_time, operator = "TM_Equals")
  • The output file does not contain a filending, it has to be renamed to *.tiff or similar
  • Does not work with current sos4R development version ( 0.3-x)


  • Topic created by: DanielNuest
  • Topic created on: 2013-01-17
Topic attachments
I Attachment Action Size Date Who Comment
AirQualityMapping.RDataRData AirQualityMapping.RData manage 2 MB 17 Jan 2013 - 10:52 DanielNuest  
AirQualityMapping.rr AirQualityMapping.r manage 15 K 17 Jan 2013 - 10:53 DanielNuest  
Linking_Web_Processing_Technology_and_SWE.pngpng Linking_Web_Processing_Technology_and_SWE.png manage 24 K 17 Jan 2013 - 10:54 DanielNuest  
SaxonyAirQualityIDW.javajava manage 6 K 17 Jan 2013 - 10:52 DanielNuest  
processDescription.xmlxml processDescription.xml manage 3 K 17 Jan 2013 - 13:34 DanielNuest  
wmsConfig.xmlxml wmsConfig.xml manage 6 K 17 Jan 2013 - 10:51 DanielNuest  
Topic revision: r9 - 19 Mar 2013, DanielNuest
Legal Notice | Privacy Statement

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback