error in connection between R and wps

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

error in connection between R and wps

soshi
Hi all,
I think set all required configuration for connection between Rserve and wps.
but I didn't see any R process in GetCapabilities response.!!!

setup Rserve:
http://www.originlab.com/doc/Origin-Help/Setup-R-Server

and setup wps:
add  localRAlgoirthmRepository in webAdmin Console using wps_config.xml

and also I did telnet localhost 6311

could anyone help me, please.
thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

BenjaminPross
Hi,

Please don't create duplicate threads!

Regarding your problem: You will have to activate the LocalRAlgorithmRepository in the wps_config_geotools.xml, not in the wps_config.xml. If you already did that, please attach the log file of the WPS.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

soshi
actually, I just added into webAdmin console interface.

wps_config.xml:

<Repository name="LocalRAlgorithmRepository"
                        className="org.n52.wps.server.r.LocalRAlgorithmRepository" active="true">
                </Repository>

wps_config_geotools:
<Repository name="LocalRAlgorithmRepository" className="org.n52.wps.server.r.LocalRAlgorithmRepository" active="false">
      <Property name="R_RserveHost" active="true">localhost</Property>
      <Property name="R_RservePassword" active="true">123456</Property>
      <Property name="R_RservePort" active="true">6311</Property>
      <Property name="R_RserveUser" active="true">admin</Property>
      <Property name="R_cacheProcesses" active="true">true</Property>
      <Property name="R_datatypeConfig" active="true">R/R_Datatype.conf</Property>
      <Property name="R_enableBatchStart" active="true">true</Property>
      <Property name="R_resourceDirectory" active="true">R/resources</Property>
      <Property name="R_scriptDirectory" active="true">R/scripts</Property>
      <Property name="R_session_memoryLimit" active="true">1000</Property>
      <Property name="R_wdName" active="false">myName</Property>
      <Property name="R_wdStrategy" active="true">default</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.Random</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.idw</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.image</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.interpolation.jsclient</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.meuse.rdata</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.pegelReport</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.sweaveFoo</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.timeseriesPlot</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.uniform.simple</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.uniform.table</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.enviroCar_osmMatching</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.eo2hAirQuality</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.geo.poly.attribute-sum</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.geo.poly.intersection</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.highlight</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.netCDF_aggregation</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.null</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.calculator</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.csv</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.defaults</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.echo</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.geo</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.image</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.resources</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.session</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.warnings</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.wpsOff</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.uncertweb.make-realizations</Property>
    </Repository>

now, I'm going to see all R process in GetCapabilities response in order to get request from all R process.
thanks
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

soshi
I change false to true in LocalRAlgorithmRepository (wps_config_geotools.xml) and restart tomcat,
so I got Capabilities response, there is some R process in it but not all of R process (into R/script folder).
how can i see all of R process into GetCapabilites??

Response:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<wps:Capabilities xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WPS" version="1.0.0" xml:lang="en-US" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsGetCapabilities_response.xsd" updateSequence="1">
<ows:ServiceIdentification>
<ows:Title>52°North WPS 3.6.2-SNAPSHOT</ows:Title>
<ows:Abstract>
Service based on the 52°North implementation of WPS 1.0.0
</ows:Abstract>
<ows:Keywords>
<ows:Keyword>WPS</ows:Keyword>
<ows:Keyword>geospatial</ows:Keyword>
<ows:Keyword>geoprocessing</ows:Keyword>
</ows:Keywords>
<ows:ServiceType>WPS</ows:ServiceType>
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
<ows:Fees>NONE</ows:Fees>
<ows:AccessConstraints>NONE</ows:AccessConstraints>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>52North</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.52north.org/"/>
<ows:ServiceContact>
<ows:IndividualName>Your name</ows:IndividualName>
<ows:PositionName>Your position</ows:PositionName>
<ows:ContactInfo>
<ows:Phone>
<ows:Voice/>
<ows:Facsimile/>
</ows:Phone>
<ows:Address>
<ows:DeliveryPoint/>
<ows:City/>
<ows:AdministrativeArea/>
<ows:PostalCode/>
<ows:Country/>
<ows:ElectronicMailAddress/>
</ows:Address>
</ows:ContactInfo>
</ows:ServiceContact>
</ows:ServiceProvider>
<ows:OperationsMetadata>
<ows:Operation name="GetCapabilities">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="http://localhost:8080/wps/WebProcessingService?"/>
<ows:Post xlink:href="http://localhost:8080/wps/WebProcessingService"/>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
<ows:Operation name="DescribeProcess">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="http://localhost:8080/wps/WebProcessingService?"/>
<ows:Post xlink:href="http://localhost:8080/wps/WebProcessingService"/>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
<ows:Operation name="Execute">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="http://localhost:8080/wps/WebProcessingService?"/>
<ows:Post xlink:href="http://localhost:8080/wps/WebProcessingService"/>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
</ows:OperationsMetadata>
<wps:ProcessOfferings>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.geo</ows:Identifier>
<ows:Title>Test script for geospatial data output</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="42">
<ows:Identifier>org.n52.wps.server.r.demo.uniform.table</ows:Identifier>
<ows:Title>Random number generator</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.csv</ows:Identifier>
<ows:Title>Test script for csv output</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.Random</ows:Identifier>
<ows:Title>Random number generator</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.geo.poly.intersection</ows:Identifier>
<ows:Title>id</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.meuse.rdata</ows:Identifier>
<ows:Title>Script that returns meuse data as rdata-files</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.idw</ows:Identifier>
<ows:Title>Inverse Distance Interpolation in R</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.sweaveFoo</ows:Identifier>
<ows:Title>Creates a pdf report based on a simple Sweave file</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.timeseriesPlot</ows:Identifier>
<ows:Title>Plot SOS Time Series</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.interpolation.jsclient</ows:Identifier>
<ows:Title>Interpolation</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.resources</ows:Identifier>
<ows:Title>Resources-Tester</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.image</ows:Identifier>
<ows:Title>
demo image process generating a plot of the Meuse dataset
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.wpsOff</ows:Identifier>
<ows:Title>dummy process for testing wps.off annotations</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.uniform.simple</ows:Identifier>
<ows:Title>A Simple WPS Process</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.netCDF_aggregation</ows:Identifier>
<ows:Title>Process for aggregation of netCDF file data</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.image</ows:Identifier>
<ows:Title>
demo image process generating a plot of the Meuse dataset
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.warnings</ows:Identifier>
<ows:Title>Warnings-Tester</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.echo</ows:Identifier>
<ows:Title>dummy echo process</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.session</ows:Identifier>
<ows:Title>Test script for session variables</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.defaults</ows:Identifier>
<ows:Title>dummy process</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.uncertweb.make-realizations</ows:Identifier>
<ows:Title>Realization process UncertWeb</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.eo2hAirQuality</ows:Identifier>
<ows:Title>
creates a coverage with interpolated air quality parameters from a SOS
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.test.calculator</ows:Identifier>
<ows:Title>process for misusing R as a calculator</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.demo.pegelReport</ows:Identifier>
<ows:Title>Gauge Report</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.enviroCar_osmMatching</ows:Identifier>
<ows:Title>envirocar track to OSM streets matching</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.highlight</ows:Identifier>
<ows:Title>
Transforms an R script into HTML/CSS with syntax highlights using the highlight package
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.geo.poly.attribute-sum</ows:Identifier>
<ows:Title>Sum of attributes for Polygons</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.1.0">
<ows:Identifier>
org.n52.wps.server.algorithm.test.MultiReferenceInputAlgorithm
</ows:Identifier>
<ows:Title>for testing multiple inputs by reference</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.coordinatetransform.CoordinateTransformAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.coordinatetransform.CoordinateTransformAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>org.n52.wps.server.algorithm.test.EchoProcess</ows:Identifier>
<ows:Title>Echo process</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.simplify.DouglasPeuckerAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.simplify.DouglasPeuckerAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.intersection.IntersectionAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.intersection.IntersectionAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.test.LongRunningDummyTestClass
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.test.LongRunningDummyTestClass
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>org.n52.wps.server.algorithm.test.DummyTestClass</ows:Identifier>
<ows:Title>org.n52.wps.server.algorithm.test.DummyTestClass</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.spatialquery.IntersectsAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.spatialquery.IntersectsAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.1.0">
<ows:Identifier>
org.n52.wps.server.algorithm.test.MultiReferenceBinaryInputAlgorithm
</ows:Identifier>
<ows:Title>for testing multiple binary inputs by reference</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.convexhull.ConvexHullAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.convexhull.ConvexHullAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.1.0">
<ows:Identifier>org.n52.wps.server.algorithm.SimpleBufferAlgorithm</ows:Identifier>
<ows:Title>org.n52.wps.server.algorithm.SimpleBufferAlgorithm</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>org.n52.wps.demo.ConvexHullDemo</ows:Identifier>
<ows:Title>org.n52.wps.demo.ConvexHullDemo</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.1.0">
<ows:Identifier>
org.n52.wps.server.algorithm.JTSConvexHullAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.JTSConvexHullAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.test.MultipleComplexInAndOutputsDummyTestClass
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.test.MultipleComplexInAndOutputsDummyTestClass
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.spatialquery.TouchesAlgorithm
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.spatialquery.TouchesAlgorithm
</ows:Title>
</wps:Process>
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>
org.n52.wps.server.algorithm.raster.AddRasterValues
</ows:Identifier>
<ows:Title>
org.n52.wps.server.algorithm.raster.AddRasterValues
</ows:Title>
</wps:Process>
</wps:ProcessOfferings>
<wps:Languages>
<wps:Default>
<ows:Language>en-US</ows:Language>
</wps:Default>
<wps:Supported>
<ows:Language>en-US</ows:Language>
</wps:Supported>
</wps:Languages>
</wps:Capabilities>
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

BenjaminPross
Which ones are missing? Did you add your own scripts?
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

soshi
For example I want to upload r script using webAdmin console,
after that I uploaded R process, nothing happend and the process didn't add to localRAlgorithmRepository automatically. why?so I couldn't see the process in capabiliteis.

R process  example: RandomNumebers

# wps.des: id = Random, title = Random number generator,
# abstract = Generates random numbers for uniform destibution;
# wps.in: min, double, Minimum, All outcomes are larger than min, value = 0;
# wps.in: max, double, Maximum, All outcomes are smaller than max, value = 1;
# wps.in: n, integer, amount of random numbers, value = 100;
# random number:
x = runif (n, min=min, max = max)
output = "outpurtfilename"
write.table(x, output)
# wps.out: output, text, Random number list, Textfile containing n random numbers in one column;
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

soshi
the problem was solved,
if script has error, it will not add to process in wps, right?
how can I bebug or get error in R script?
should I run both wps and R, and get error from script in R software?
and how about if I have image input  in request? how can I get error?
Reply | Threaded
Open this post in threaded view
|

Re: error in connection between R and wps

BenjaminPross
Yes, if the script has errors, it will not be added to the capabilities.
If there are errors, they should be logged. YOu can find the log file in the logs directory of your Tomcat installation. It is called 52n-wps.log

You can find additional information about WPS4R here: https://wiki.52north.org/Geoprocessing/GeoprocessingTutorials#WPS4R_tutorials