Hi all,<br><br>Yes ReLuc, we will publish the OGR demo and others shortly <br>This will be included in the zoo project website update<br><br>Cheers<br><br>Nick<br><br><br><div class="gmail_quote">2010/1/9 René-Luc D'Hont <span dir="ltr"><<a href="mailto:rldhont@gmail.com">rldhont@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


  
  

<div text="#000000" bgcolor="#ffffff">
Hi All,<br>
<br>
This story is a very good point to demonstrate the ZOO capabilities!<br>
<br>
Could we publish the ZOO OGR demo ?<br>
<br>
René-Luc D'Hont<br>
3Liz<br>
<br>
Le 09/01/2010 02:28, Gérald Fenoy a écrit :
<blockquote type="cite"><div><div></div><div class="h5">Hi ZOO Tribe member,<br>
I have a story to share with you. <br>
  <br>
  <br>
-----------------------------------------<br>
Today, in the cold of France, *somebody* called me on phone and tell me
that Lourent Jégou wrote an article on his blog [1] about using R with
pyWPS.<br>
Laurent also mentioned that he did this choice, using pyWPS, cause ZOO
Kernel is still unavailable (I use ZOO Kernel here, even if he spoke
about "Zoo", in fact he means ZOO Kernel here). Oups, sorry for this
point.<br>
So, *somebody* send me the link [2], unfortunately I wasn't in front of
my computer so unable to read anything :). I asked him if the python
code quoted in the article was available or not. As, he answered me it
was, I told him that I call him back to tell him when the process was
modified to be used from the ZOO Kernel.<br>
  <br>
So I gone back on my computer and check this web page, fethcing the
python code then copying the logic only included in the python file
from the article  (no metadata, as metadata and logic is separated in
ZOO Kernel).<br>
  <br>
Here "the logic code" I talk about was pointed in the full
ServiceProvider, providing only one service called discretise :<br>
  <br>
import rpy2.robjects as robjects<br>
import sys<br>
  <br>
def discretise(main,inputs,outputs):<br>
       # the following lines are need only because of <br>
       # strange issue specific to R displaying msg :<br>
       # Loading required package: class<br>
       try:<br>
               sys.stdout.close()<br>
       except:<br>
               pass<br>
       # The logic code<br>
       robjects.r('library(e1071)')<br>
       robjects.r('library(classInt)')<br>
       robjects.r('library(XML)')<br>
       robjects.r('data(jenks71)')<br>
       robjects.r('doc = xmlRoot(xmlTreeParse("%s"))' %
inputs['donnees']['value'])<br>
       xsa = robjects.r.xmlSApply<br>
       jenksData = robjects.r('xmlSApply(doc, function(x)
as.numeric(xmlSApply(x, xmlValue)))')<br>
       ci = robjects.r.classIntervals<br>
       tmp=int(inputs['nbClasses']['value'])<br>
       out = str(ci(jenksData, n = tmp, style =
inputs['methode']['value']))<br>
       outputs["Result"]={"value": out,"dataType":"string"}<br>
       return 3<br>
  <br>
  <br>
Then I copied the hellof.zcfg metadata file (the ZOO Configuration File
for the sample Fortran ServiceProvider) into a new one called
discretise.zcfg. I tested ... it and it works :)<br>
In fact it shuldn't work but I know that ZOO Kernel is really
permissive when passing arguments to ServiceProvider function.... This
explains why the hellof.zcfg file was enough to run the process...
Nevertheless, in some sens, that let devs make their tests on their new
service provider before putting them publicly available all over the
web..<br>
So I correct a bit the ZOO Configuration file to get a realistic
DescribeProcess.<br>
  <br>
Finally, few minutes was requested to turn a simple pyWPS service into
a service from a ServiceProvider Python Based to be run from the ZOO
Kernel. I called back *somebody* :)<br>
  <br>
I know it's not such an interesting example, but it let me think that
the ZOO Kernel is a good tool to easily use an already existing code as
a WPS service, even if it was not (a service) at the begining. Please,
correct me if I'm wrong.<br>
  <br>
So, even if here we duplicated a WPS service to create a new one,
comparison between two solutions can be easily made for everyone
reading this story. It contains also a view about what have to be done
to integrate your own  (Python here) code as a ServiceProvider
providing WPS services through ZOO Kernel.<br>
  <br>
Separation between metadata and services as a staring point,
multi-language support in an embedded way to take control over service
to provide.<br>
  <br>
Parameters storeExecuteResponse was supported since the begining of ZOO
Kernel development (cf. hello worlds from various embedded languages
[3], [4] and [5]). It let users decide if they want to store the
ExecuteResponse (on the current demonstration server we remove files
quickly) to let him fetch/poll the statusLocation provided in the
execute answer from its client application to show status of execution
and be informed when the process was ended. It can be useful for
applcication using a cache or something.<br>
  <br>
-----------------------------------------<br>
  <br>
[1] <a href="http://www.geotests.net/blog/" target="_blank">http://www.geotests.net/blog/</a><br>
[2] <a href="http://www.geotests.net/blog/article/mise-en-place-d-un-webservice-de-discretisation-en-utilisant-pywps-et-r" target="_blank">http://www.geotests.net/blog/article/mise-en-place-d-un-webservice-de-discretisation-en-utilisant-pywps-et-r</a><br>

[3] <a href="http://demo.zoo-project.org/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=hellof&DataInputs=S=Your%20Name%20Here@datatype=string&storeExecuteResponse=true" target="_blank">http://demo.zoo-project.org/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=hellof&DataInputs=S=Your%20Name%20Here@datatype=string&storeExecuteResponse=true</a><br>

[4] <a href="http://demo.zoo-project.org/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=HelloWorldJava&DataInputs=S=Your%20Name%20Here@datatype=string&storeExecuteResponse=true" target="_blank">http://demo.zoo-project.org/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=HelloWorldJava&DataInputs=S=Your%20Name%20Here@datatype=string&storeExecuteResponse=true</a><br>

[5] <a href="http://demo.zoo-project.org/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=HelloPHP&DataInputs=S=Your%20Name%20Here@datatype=string&storeExecuteResponse=true" target="_blank">http://demo.zoo-project.org/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=HelloPHP&DataInputs=S=Your%20Name%20Here@datatype=string&storeExecuteResponse=true</a><br>

  <br>
-----------------------------------------<br>
  <br>
*somebody* was abviously Nick !<br>
  <br>
Hope to hear from you ZOO Tribe members,<br>
  <br>
  <br>
Djay<br>
Just a ZOO Monkey<br>
  <a href="mailto:gerald.fenoy@geolabs.fr" target="_blank">gerald.fenoy@geolabs.fr</a><br>
  <div><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div><span style="font-size: 12px;">
  <div style="margin: 0px;"><span style="font-size: medium;"><br>
  </span></div>
  </span></div>
  </span></div>
  </div></div><pre><fieldset></fieldset>
_______________________________________________
Zoo-discuss mailing list
<a href="mailto:Zoo-discuss@gisws.media.osaka-cu.ac.jp" target="_blank">Zoo-discuss@gisws.media.osaka-cu.ac.jp</a>
<a href="http://gisws.media.osaka-cu.ac.jp/mailman/listinfo/zoo-discuss" target="_blank">http://gisws.media.osaka-cu.ac.jp/mailman/listinfo/zoo-discuss</a>
  </pre>
</blockquote>
<br>
</div>

<br>_______________________________________________<br>
Zoo-discuss mailing list<br>
<a href="mailto:Zoo-discuss@gisws.media.osaka-cu.ac.jp">Zoo-discuss@gisws.media.osaka-cu.ac.jp</a><br>
<a href="http://gisws.media.osaka-cu.ac.jp/mailman/listinfo/zoo-discuss" target="_blank">http://gisws.media.osaka-cu.ac.jp/mailman/listinfo/zoo-discuss</a><br>
<br></blockquote></div><br>