Hands-On Exercise 10: prepare an OGC Web Processing Service

In this exercise we will prepare our workflow in order to expose an OGC Web Processing Service (WPS) [1] interface, and we will trigger it through a WPS Client.

Prerequisites

Install the Hands-On

  • Install the Hands-On Exercise 10, just type:
cd
cd dcs-hands-on
mvn clean install -D hands.on=10 -P bash

Inspect the application.xml

  • Inspect the application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<application id="beam_arithm">
  <jobTemplates>
    <!-- BEAM BandMaths operator job template  -->
    <jobTemplate id="expression">
      <streamingExecutable>/application/expression/run</streamingExecutable>
      <defaultParameters>           
        <parameter id="expression">l1_flags.INVALID?0:radiance_13>15?0:100+radiance_9-(radiance_8+(radiance_10-radiance_8)*27.524/72.570)</parameter>
        <parameter id="startdate" title="Start date" abstract="Start date of the TOI. Used as queryable for the MERIS Level 1 catalogue" scope="runtime" type="opensearch" target="time:start">2012-04-06T10:24:29.000Z</parameter>
        <parameter id="enddate" title="End date" abstract="End date of the TOI. Used as queryable for the MERIS Level 1 catalogue" scope="runtime" type="opensearch" target="time:end">2012-04-07</parameter>
        <parameter id="qbbox" title="Bounding Box" abstract="The bounding box parameter" scope="runtime" type="opensearch" target="geo:box">2.99,58.45,0.53,58.26</parameter>
      </defaultParameters>
    </jobTemplate>
    <!-- BEAM Level 3 processor job template  -->
    <jobTemplate id="binning">
      <streamingExecutable>/application/binning/run</streamingExecutable>
      <defaultParameters>           
        <parameter id="cellsize">9.28</parameter>
        <parameter id="bandname">out</parameter>
        <parameter id="bitmask">l1_flags.INVALID?0:radiance_13>15?0:100+radiance_9-(radiance_8+(radiance_10-radiance_8)*27.524/72.570)</parameter>
        <parameter id="bbox">-180,-90,180,90</parameter>
        <parameter id="algorithm">MIN_MAX</parameter>
        <parameter id="outputname">binned</parameter>
        <parameter id="resampling">binning</parameter>
        <parameter id="palette">#MCI_Palette
color0=0,0,0
color1=0,0,154
color2=54,99,250
color3=110,201,136
color4=166,245,8
color5=222,224,0
color6=234,136,0
color7=245,47,0
color8=255,255,255
numPoints=9
sample0=98.19878118960284
sample1=98.64947122314665
sample2=99.10016125669047
sample3=99.5508512902343
sample4=100.0015413237781
sample5=100.4522313573219
sample6=100.90292139086574
sample7=101.35361142440956
sample8=101.80430145795337</parameter>
        <parameter id="band">1</parameter>
        <parameter id="tailor">true</parameter>
      </defaultParameters>
      <defaultJobconf>
              <property id="ciop.job.max.tasks">1</property>
            </defaultJobconf>
    </jobTemplate>
  </jobTemplates>
    <workflow id="hands-on-10" title="Prepare an OGC Web Processing Service" abstract="Exercise 10, prepare an OGC Web Processing Service">           
    <workflowVersion>1.0</workflowVersion>
    <node id="node_expression">       
      <job id="expression"></job>     
      <sources>
        <source refid="cas:series">https://catalog.terradue.com/eo-samples/series/mer_rr__1p/description</source>
      </sources>
      <parameters>          
      </parameters>
    </node>
    <node id="node_binning">        
      <job id="binning"></job>      
      <sources>
        <source refid="wf:node">node_expression</source>        
      </sources>
      <parameters>
        <parameter id="bitmask"/>   
      </parameters>
    </node>
  </workflow>
</application>

Note the informational attributes for the WPS in the <workflow> tag:

    <workflow id="hands-on-10" title="Prepare an OGC Web Processing Service" abstract="Exercise 10, prepare an OGC Web Processing Service">           

Note the informational attributes in the <parameter> tags, to be exposed through the WPS. Also note the scope=”runtime” attribute:

    <jobTemplate id="expression">
      <streamingExecutable>/application/expression/run</streamingExecutable>
      <defaultParameters>           
        <parameter id="expression">l1_flags.INVALID?0:radiance_13>15?0:100+radiance_9-(radiance_8+(radiance_10-radiance_8)*27.524/72.570)</parameter>
        <parameter id="startdate" title="Start date" abstract="Start date of the TOI. Used as queryable for the MERIS Level 1 catalogue" scope="runtime" type="opensearch" target="time:start">2012-04-06T10:24:29.000Z</parameter>
        <parameter id="enddate" title="End date" abstract="End date of the TOI. Used as queryable for the MERIS Level 1 catalogue" scope="runtime" type="opensearch" target="time:end">2012-04-07</parameter>
        <parameter id="qbbox" title="Bounding Box" abstract="The bounding box parameter" scope="runtime" type="opensearch" target="geo:box">2.99,58.45,0.53,58.26</parameter>
      </defaultParameters>
    </jobTemplate>

Trigger the WPS service

  • Open a browser and type http://$HOSTNAME/dashboard
  • Click on the tab Invoke,
  • Click on the link Prepare an OGC Web Processing Service under Process List,
  • Type in the field Start date the value 2012-04-06T10:24:29.000Z,
  • Type in the field End date the value 2012-04-07,
  • Type in the field Bounding Box the value 2.99,58.45,0.53,58.26,
  • Click on the button Run Process,
  • Follow the execution until it ends (more or less five minutes).

The following images show the steps that we have just performed:

WPS Service
WPS Service
WPS Service
WPS Service
WPS Service

Recap

  1. We prepared an application.xml suitable for the OGC WPS;
  2. We triggered the service through the WPS Client included in the Sandbox Dashboard.

Footnotes

[1]OGC Web Processing Service