<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
This is the script for Driftx WPS chaining :<br>
<br>
function DriftxJS(aConf,aInputs,aOutputs) {<br>
  try {<br>
    var outputs=new Array();<br>
    outputs[0]={};<br>
  var inputs = {};<br>
  for (var i=0, len=aInputs.length; i<len; i++) {<br>
    var input = aInputs[i];<br>
    for (var key in input) {<br>
      inputs[key] = input[key];<br>
    }<br>
  }<br>
  var wps = new ZOO.Format.WPS();<br>
  var json = new ZOO.Format.JSON();<br>
  var wpProcess = new
ZOO.Process('<a class="moz-txt-link-freetext" href="http://localhost/zoosoo/driftx/wps/','writeParams">http://localhost/zoosoo/driftx/wps/','writeParams</a>');<br>
  var wpInputs = {<br>
    session:inputs.session,<br>
    xmin:inputs.xmin,<br>
    ymin:inputs.ymin,<br>
    xmax:inputs.xmax,<br>
    ymax:inputs.ymax,<br>
    vstartx:inputs.vstartx,<br>
    vstarty:inputs.vstarty,<br>
    nbrowsp:inputs.nbrowsp,<br>
    rowsleng:inputs.rowsleng,<br>
    tractorsp:inputs.tractorsp,<br>
    numrowsin:inputs.numrowsin,<br>
    nozzoutvel:inputs.nozzoutvel,<br>
    windx1:inputs.windx1,<br>
    windy1:inputs.windy1,<br>
    windspeed1:inputs.windspeed1,<br>
    winddir1:inputs.winddir1,<br>
    windx2:inputs.windx2,<br>
    windy2:inputs.windy2,<br>
    windspeed2:inputs.windspeed2,<br>
    winddir2:inputs.winddir2<br>
  };<br>
  var wpOutput = wpProcess.Execute(wpInputs);<br>
  wpOutput = wps.read(wpOutput);<br>
  var clipProcess = new
ZOO.Process('<a class="moz-txt-link-freetext" href="http://localhost/zoosoo/driftx/wps/','Gdal_Translate">http://localhost/zoosoo/driftx/wps/','Gdal_Translate</a>');<br>
  var ProjWin =
inputs.xmin.value+','+inputs.ymax.value+','+inputs.xmax.value+','+inputs.ymin.value+',urn:ogc:def:crs:EPSG:6.6:27572,2';<br>
  var clipInputs = {<br>
    Format:{value:'AAIGRID',datatype:'string'},<br>
    InputDSN:{value:'neffiesL2',datatype:'string'},<br>
    OutputDSN:{value:'neffiesL2_output',datatype:'string'},<br>
    SRS:{value:'EPSG:27572',datatype:'string'},<br>
    Type:{value:'Float32',datatype:'string'},<br>
    ProjWin:{value:ProjWin}<br>
  };<br>
  var clipOutput = clipProcess.Execute(clipInputs);<br>
  clipOutput = wps.read(clipOutput);<br>
  var csvProcess = new
ZOO.Process('<a class="moz-txt-link-freetext" href="http://localhost/zoosoo/driftx/wps/','grd2xyz">http://localhost/zoosoo/driftx/wps/','grd2xyz</a>');<br>
  var csvInputs = {<br>
    inFile:{value:clipOutput.value,datatype:'string'},<br>
   
outFile:{value:aConf[0]['main']['tmpPath']+'/mnt.csv',datatype:'string'}<br>
  };<br>
  var csvOutput = csvProcess.Execute(csvInputs);<br>
  csvOutput = wps.read(csvOutput);<br>
  /*<br>
  var ftnProcess = new ZOO.Process('<a class="moz-txt-link-freetext" href="http://localhost/zoo/','driftx">http://localhost/zoo/','driftx</a>');<br>
  var ftnInputs = {<br>
    storePath:{value:aConf[0]['main']['tmpPath']+'/',datatype:'string'}<br>
  };<br>
  var ftnOutput = ftnProcess.Execute(ftnInputs);<br>
  var ftnOutput =
ZOO.Request.Get('<a class="moz-txt-link-freetext" href="http://localhost/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=driftx&DataInputs=storePath=/var/www/localhost/htdocs/ms_tmp/@datatype=string">http://localhost/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=driftx&DataInputs=storePath=/var/www/localhost/htdocs/ms_tmp/@datatype=string</a>');<br>
  */<br>
  var ftnOutput =
ZOO.Request.Get('<a class="moz-txt-link-freetext" href="http://localhost/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=driftx&DataInputs=storePath='+aConf">http://localhost/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=driftx&DataInputs=storePath='+aConf</a>[0]['main']['tmpPath']+'/@datatype=string');<br>
  var result = ZOO.Request.Get('<a class="moz-txt-link-freetext" href="http://localhost/ms_tmp/driftx.csv">http://localhost/ms_tmp/driftx.csv</a>')<br>
  var ftxt = new ZOO.Format.Text({separator:',',<br>
                                  xcolumn:'longitude',<br>
                                  ycolumn:'latitude'});<br>
  result = ftxt.read(result);<br>
  var depotmax = 0;<br>
  result.forEach(function(ft,idx) {<br>
      if(Number(ft.attributes.depot)==0)<br>
        ft.attributes.display = 'none';<br>
      else<br>
        ft.attributes.display = '';<br>
      var depot = Number(ft.attributes.depot);<br>
      if (depot > depotmax)<br>
        depotmax=depot;<br>
  });<br>
  var qt = depotmax/5;<br>
  var limites = [qt,2*qt,3*qt,4*qt];<br>
  result.forEach(function(ft,idx) {<br>
      var depot = Number(ft.attributes.depot);<br>
      if (depot<limites[0])<br>
       ft.attributes.color = '#000066';<br>
      else if (depot<limites[1])<br>
       ft.attributes.color = '#006600';<br>
      else if (depot<limites[2])<br>
       ft.attributes.color = '#FFFF00';<br>
      else if (depot<limites[3])<br>
       ft.attributes.color = '#FFA500';<br>
      else<br>
       ft.attributes.color = '#E00100';<br>
  });<br>
  var geojson = new ZOO.Format.GeoJSON();<br>
  outputs[0]["result"]={"value": geojson.write(result),
"dataType":'string'};<br>
  /*<br>
  outputs[0]["result"]={"value":
ftxt.separator+'\n'+ftxt.xcolumn+'\n'+result2.length,
"dataType":'string'};<br>
  */<br>
  return {"result":3,"outputs": outputs};<br>
  } catch(e) {<br>
    outputs[0]["result"]={"value": e, "dataType":'string'};<br>
    return {"result":3,"outputs": outputs};<br>
  }<br>
}<br>
<br>
As you see ZOO JS API could be for managing and chaining process
providing by different WPS.<br>
<br>
Cheers,<br>
<br>
René-Luc D'Hont<br>
3Liz<br>
<br>
<br>
Le 17/05/2010 09:04, <a class="moz-txt-link-abbreviated" href="mailto:James.Sewell@lisasoft.com">James.Sewell@lisasoft.com</a> a écrit :
<blockquote
 cite="mid:CB506E813C77E9498F043F1F951BB2768DF5F3E6B2@optimus.ms.a2end.com"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <meta name="Generator" content="Microsoft Word 12 (filtered medium)">
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
h5
        {mso-style-priority:9;
        mso-style-link:"Heading 5 Char";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Heading5Char
        {mso-style-name:"Heading 5 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 5";
        font-family:"Times New Roman","serif";
        font-weight:bold;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
  </style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="Section1">
  <p class="MsoNormal">Hey All,<o:p></o:p></p>
  <p class="MsoNormal"><o:p> </o:p></p>
  <p class="MsoNormal">On the zoo-project IRC channel demo examples and
the lack of
documentation for the ZOO JS API were discussed recently.<o:p></o:p></p>
  <p class="MsoNormal"><o:p> </o:p></p>
  <p class="MsoNormal">I realize that there is no documentation at the
moment, but
if anyone has some demos of how the API can be used to achieve process
chaining
would they be able to post it to the list? <o:p></o:p></p>
  <h5
 style="background: white none repeat scroll 0% 0%; margin-bottom: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><span
 style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125); font-weight: normal;">Cheers,</span><o:p></o:p></h5>
  <h5
 style="margin: 0cm 0cm 0.0001pt; background: white none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><span
 style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125); font-weight: normal;">James
Sewell</span><o:p></o:p></h5>
  <h5
 style="margin: 0cm 0cm 0.0001pt; background: white none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><span
 style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125); font-weight: normal;">LISAsoft
Developer</span><o:p></o:p></h5>
  <h5
 style="margin: 0cm 0cm 0.0001pt; background: white none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><span
 style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125); font-weight: normal;">+61
(3) 8680 3200 / +61 414 688 892</span><o:p></o:p></h5>
  <p class="MsoNormal"><o:p> </o:p></p>
  </div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Zoo-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Zoo-discuss@gisws.media.osaka-cu.ac.jp">Zoo-discuss@gisws.media.osaka-cu.ac.jp</a>
<a class="moz-txt-link-freetext" href="http://gisws.media.osaka-cu.ac.jp/mailman/listinfo/zoo-discuss">http://gisws.media.osaka-cu.ac.jp/mailman/listinfo/zoo-discuss</a>
  </pre>
</blockquote>
<br>
</body>
</html>