[GRASS-dev] GRASS GIS 7 and QGIS connected using the Web Processing Service (WPS)

Dear developers,
i would just like to inform you about the latest development in WPS,
GRASS GIS 7 and QGIS.
Using the latest svn versions of GRASS GIS 7, PyWPS, wps-grass-bridge
and the WPS Plugin from Horst Düster for QGIS it is possible to run
more than hundred GRASS modules from QGIS out of the box.

Have a look at this simple demo video:
http://www.youtube.com/watch?v=zCnax9w1bCs

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

Best regards
Soeren

Hi,
i would like to inform you that GRASS GIS 7 is now available via the
ZOO WPS server using the wps-grass-bridge.
Gérald Fenoy the main developer of the ZOO project has made a nice
video using QGIS with WPS plugin:
http://www.youtube.com/watch?v=DzgFIox3FA8

The ZOO project:
http://zoo-project.org/

Now hundreds of GRASS GIS 7 vector and raster modules can be attached
out of the box to ZOO WPS, PyWPS and 52N WPS using the
wps-grass-bridge. :slight_smile:

Best regards
Soeren

2011/1/28 Soeren Gebbert <soerengebbert@googlemail.com>:

Dear developers,
i would just like to inform you about the latest development in WPS,
GRASS GIS 7 and QGIS.
Using the latest svn versions of GRASS GIS 7, PyWPS, wps-grass-bridge
and the WPS Plugin from Horst Düster for QGIS it is possible to run
more than hundred GRASS modules from QGIS out of the box.

Have a look at this simple demo video:
http://www.youtube.com/watch?v=zCnax9w1bCs

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

Best regards
Soeren

Soeren,

Thanks for the great work on WPS integration !

On 28/01/11 11:44, Soeren Gebbert wrote:

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

I've tried following the above instructions, and the server does give a correct answer for GetCapabilities. I can also see the list of modules in the QGIS WPS plugin and get the GUI of a module. However, once I run the module I always get the following error, whatever the module I try:

      <wps:ProcessFailed>
             <wps:ExceptionReport>
                 <ows:Exception exceptionCode="NoApplicableCode">
                     <ows:ExceptionText>argument 1 must be string or buffer, not None</ows:ExceptionText>
                 </ows:Exception>
             </wps:ExceptionReport>
         </wps:ProcessFailed>

Any idea what could be wrong ? I can't find a way to see what URL the QGIS plugin sends to the server.

Moritz

Hi Moritz,
the problem may be related to the QGIS WPS plugin version. The plugin
is still in an experimental state and under active development, but
the latest SVN version should be usable. Which version of the plugin
do you use?

Best regards
Soeren

2011/4/14 Moritz Lennert <mlennert@club.worldonline.be>:

Soeren,

Thanks for the great work on WPS integration !

On 28/01/11 11:44, Soeren Gebbert wrote:

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

I've tried following the above instructions, and the server does give a
correct answer for GetCapabilities. I can also see the list of modules in
the QGIS WPS plugin and get the GUI of a module. However, once I run the
module I always get the following error, whatever the module I try:

&lt;wps:ProcessFailed&gt;
       &lt;wps:ExceptionReport&gt;
           &lt;ows:Exception exceptionCode=&quot;NoApplicableCode&quot;&gt;
               &lt;ows:ExceptionText&gt;argument 1 must be string or buffer,

not None</ows:ExceptionText>
</ows:Exception>
</wps:ExceptionReport>
</wps:ProcessFailed>

Any idea what could be wrong ? I can't find a way to see what URL the QGIS
plugin sends to the server.

Moritz

On 15/04/11 09:20, Soeren Gebbert wrote:

Hi Moritz,
the problem may be related to the QGIS WPS plugin version. The plugin
is still in an experimental state and under active development, but
the latest SVN version should be usable. Which version of the plugin
do you use?

0.5.

Moritz

Best regards
Soeren

2011/4/14 Moritz Lennert<mlennert@club.worldonline.be>:

Soeren,

Thanks for the great work on WPS integration !

On 28/01/11 11:44, Soeren Gebbert wrote:

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

I've tried following the above instructions, and the server does give a
correct answer for GetCapabilities. I can also see the list of modules in
the QGIS WPS plugin and get the GUI of a module. However, once I run the
module I always get the following error, whatever the module I try:

     <wps:ProcessFailed>
            <wps:ExceptionReport>
                <ows:Exception exceptionCode="NoApplicableCode">
                    <ows:ExceptionText>argument 1 must be string or buffer,
not None</ows:ExceptionText>
                </ows:Exception>
            </wps:ExceptionReport>
        </wps:ProcessFailed>

Any idea what could be wrong ? I can't find a way to see what URL the QGIS
plugin sends to the server.

Moritz

Hi Moritz,
i can reproduce this bug using the SVN revision 63. I have applied a
patch which should solve the problem and which will add new shiny
features (i was to lazy to remove the features from the patch).

Please apply the patch to the latest svn version of the plugin.

Best regards
Soeren

2011/4/15 Moritz Lennert <mlennert@club.worldonline.be>:

On 15/04/11 09:20, Soeren Gebbert wrote:

Hi Moritz,
the problem may be related to the QGIS WPS plugin version. The plugin
is still in an experimental state and under active development, but
the latest SVN version should be usable. Which version of the plugin
do you use?

0.5.

Moritz

Best regards
Soeren

2011/4/14 Moritz Lennert<mlennert@club.worldonline.be>:

Soeren,

Thanks for the great work on WPS integration !

On 28/01/11 11:44, Soeren Gebbert wrote:

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

I've tried following the above instructions, and the server does give a
correct answer for GetCapabilities. I can also see the list of modules in
the QGIS WPS plugin and get the GUI of a module. However, once I run the
module I always get the following error, whatever the module I try:

&lt;wps:ProcessFailed&gt;
       &lt;wps:ExceptionReport&gt;
           &lt;ows:Exception exceptionCode=&quot;NoApplicableCode&quot;&gt;
               &lt;ows:ExceptionText&gt;argument 1 must be string or

buffer,
not None</ows:ExceptionText>
</ows:Exception>
</wps:ExceptionReport>
</wps:ProcessFailed>

Any idea what could be wrong ? I can't find a way to see what URL the
QGIS
plugin sends to the server.

Moritz

(attachments)

wps-trunk_diff_15_04_2011.diff (14.6 KB)

Hi Soeren,
[cc to Horst Düster - I'm not subscribed to the QGIS lists, trying to limit my flow of mails, but we can take it over there if you prefer, but I want to make sure that this is really a plugin problem and not my bad usage of your wps-grass bridge]

On 15/04/11 09:40, Moritz Lennert wrote:

On 15/04/11 09:20, Soeren Gebbert wrote:

Hi Moritz,
the problem may be related to the QGIS WPS plugin version. The plugin
is still in an experimental state and under active development, but
the latest SVN version should be usable. Which version of the plugin
do you use?

0.5.

0.5.0 to be precice.

I've found the DEBUG option in the source code. Now I can see the request XML and the problem seems to be this (trying to launch a simple v.perturb on the busstopsall map of the shapefile collection of the nc_spm grass demo data):

<ows:Identifier>input</ows:Identifier>
<ows:Title>input</ows:Title>
<wps:Data>
<wps:ComplexData mimeType="text/xml" schema="http://schemas.opengis.net/gml/2.1.2/feature.xsd&quot; enconding="utf-8"></wps:ComplexData>
</wps:Data>
</wps:Input>

i.e. the input data info is empty.

The same seems to be true for the output data:

<ows:Identifier>input</ows:Identifier>
<ows:Title>input</ows:Title>
<wps:Data>
<wps:ComplexData mimeType="text/xml" schema="http://schemas.opengis.net/gml/2.1.2/feature.xsd&quot; enconding="utf-8"></wps:ComplexData>
</wps:Data>
</wps:Input>

Whereas the 'parameter' option contains the value I gave:

<wps:Input>
<ows:Identifier>parameters</ows:Identifier>
<ows:Title>parameters</ows:Title>
<wps:Data>
<wps:LiteralData>20</wps:LiteralData>
</wps:Data>
</wps:Input>

Here some info about my config:

pywps.cfg:

[grass]
path=/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu/bin:/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu/scripts
addonPath=
version=7.0svn
gui=text
gisbase=/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu
ldLibraryPath=/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu/lib
gisdbase=/home/mlennert/WWW/pywps/grassdata

pywps.cgi:

export PYWPS_CFG="/home/mlennert/WWW/pywps/pywps.cfg"
export PYWPS_PROCESSES="/home/mlennert/SRC/WPS_PROCESS"

and in WPS_PROCESSES I have all the files from your original wps-grass-bridge svn directory:

GlobalGrassSettings.py
GlobalGrassSettings.pyc
GrassXMLtoPyWPS.py
GrassXMLtoYAML.py
GrassXMLtoZCFG.py
PyWPSGrassModuleStarter.py

the gms and wpsXML directories (I erased the zoo-related) and a long list of grass modules descriptors, of which just the v.perturb one as example:

# ################################################ #
# This process was generated using GrassXMLtoPyWPS #
# Author: Soeren Gebbert #
# Mail: soerengebbert <at> googlemail <dot> com #
# ################################################ #

from pywps.Process import WPSProcess

from PyWPSGrassModuleStarter import PyWPSGrassModuleStarter

class v_perturb(WPSProcess):

   def __init__(self):
     WPSProcess.__init__(self, identifier = 'v.perturb', title = 'Random location perturbations of vector points.', version = 1, statusSupported = True, storeSupported = True, metadata = [{'type': 'simple', 'title': 'vector'}, {'type': 'simple', 'title': 'statistics'}], abstract = 'http://grass.osgeo.org/grass70/manuals/html70_user/v.perturb.html’)

     # Literal and complex inputs
     self.addComplexInput(identifier = 'input', title = 'Data source for direct OGR access', minOccurs = 1, maxOccurs = 1, formats = [{'mimeType': 'text/xml', 'schema': 'http://schemas.opengis.net/gml/2.1.2/feature.xsd’, 'encoding': 'UTF-8'}, {'mimeType': 'text/xml', 'schema': 'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd’, 'encoding': 'UTF-8'}, {'mimeType': 'application/dgn', 'schema': 'None', 'encoding': 'None'}, {'mimeType': 'application/shp', 'schema': 'None', 'encoding': 'None'}, {'mimeType': 'application/x-zipped-shp', 'schema': 'None', 'encoding': 'None'}])
     self.addLiteralInput(identifier = 'layer', title = 'A single vector map can be connected to multiple database tables. This number determines which table to use. Layer name for direct OGR access.', minOccurs = 1, maxOccurs = 1, type = type("string"), default = "-1")
     self.addLiteralInput(identifier = 'distribution', title = 'Distribution of perturbation', minOccurs = 0, maxOccurs = 1, type = type("string"), default = "uniform", allowedValues = ['uniform', 'normal'])
     self.addLiteralInput(identifier = 'parameters', title = 'If the distribution is uniform, only one parameter, the maximum, is needed. For a normal distribution, two parameters, the mean and standard deviation, are required.', minOccurs = 1, maxOccurs = 1024, type = type(0.0), allowedValues = '*')
     self.addLiteralInput(identifier = 'minimum', title = 'Minimum deviation in map units', minOccurs = 0, maxOccurs = 1, type = type(0.0), default = 0.0)
     self.addLiteralInput(identifier = 'seed', title = 'Seed for random number generation', minOccurs = 0, maxOccurs = 1, type = type(0), default = 0)

     # complex outputs
     self.addComplexOutput(identifier = 'output', title = 'Name for output vector map', formats = [{'mimeType': 'text/xml', 'schema': 'http://schemas.opengis.net/gml/2.1.2/feature.xsd’, 'encoding': 'UTF-8'}, {'mimeType': 'text/xml', 'schema': 'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd’, 'encoding': 'UTF-8'}])

   def execute(self):
     starter = PyWPSGrassModuleStarter()
     starter.fromPyWPS("v.perturb", self.inputs, self.outputs, self.pywps)

if __name__ == "__main__":
   process = v_perturb()
   process.execute()

Any ideas ?

Moritz

2011/4/14 Moritz Lennert<mlennert@club.worldonline.be>:

Soeren,

Thanks for the great work on WPS integration !

On 28/01/11 11:44, Soeren Gebbert wrote:

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

I've tried following the above instructions, and the server does give a
correct answer for GetCapabilities. I can also see the list of
modules in
the QGIS WPS plugin and get the GUI of a module. However, once I run the
module I always get the following error, whatever the module I try:

<wps:ProcessFailed>
<wps:ExceptionReport>
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>argument 1 must be string or buffer,
not None</ows:ExceptionText>
</ows:Exception>
</wps:ExceptionReport>
</wps:ProcessFailed>

Any idea what could be wrong ? I can't find a way to see what URL the
QGIS
plugin sends to the server.

Moritz

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hello Moritz,
the problem is the temporal GML file generation in qgswpstools.py.
This piece python code should solve the problem, which is also
included in the patch:

qgswpstools.py at line ~230

    # Check in case a ".g" was attached to the tempfile
    if os.path.isfile(tmpFile + ".g") == True:
      tmpFile = tmpFile + ".g"

This error should only occur with vector data. Raster data should work.

Best regards
Soeren

2011/4/15 Moritz Lennert <mlennert@club.worldonline.be>:

Hi Soeren,
[cc to Horst Düster - I'm not subscribed to the QGIS lists, trying to limit
my flow of mails, but we can take it over there if you prefer, but I want to
make sure that this is really a plugin problem and not my bad usage of your
wps-grass bridge]

On 15/04/11 09:40, Moritz Lennert wrote:

On 15/04/11 09:20, Soeren Gebbert wrote:

Hi Moritz,
the problem may be related to the QGIS WPS plugin version. The plugin
is still in an experimental state and under active development, but
the latest SVN version should be usable. Which version of the plugin
do you use?

0.5.

0.5.0 to be precice.

I've found the DEBUG option in the source code. Now I can see the request
XML and the problem seems to be this (trying to launch a simple v.perturb on
the busstopsall map of the shapefile collection of the nc_spm grass demo
data):

<ows:Identifier>input</ows:Identifier>
<ows:Title>input</ows:Title>
<wps:Data>
<wps:ComplexData mimeType="text/xml"
schema="http://schemas.opengis.net/gml/2.1.2/feature.xsd&quot;
enconding="utf-8"></wps:ComplexData>
</wps:Data>
</wps:Input>

i.e. the input data info is empty.

The same seems to be true for the output data:

<ows:Identifier>input</ows:Identifier>
<ows:Title>input</ows:Title>
<wps:Data>
<wps:ComplexData mimeType="text/xml"
schema="http://schemas.opengis.net/gml/2.1.2/feature.xsd&quot;
enconding="utf-8"></wps:ComplexData>
</wps:Data>
</wps:Input>

Whereas the 'parameter' option contains the value I gave:

<wps:Input>
<ows:Identifier>parameters</ows:Identifier>
<ows:Title>parameters</ows:Title>
<wps:Data>
<wps:LiteralData>20</wps:LiteralData>
</wps:Data>
</wps:Input>

Here some info about my config:

pywps.cfg:

[grass]
path=/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu/bin:/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu/scripts
addonPath=
version=7.0svn
gui=text
gisbase=/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu
ldLibraryPath=/home/mlennert/SRC/GRASS/grass_trunk/dist.i686-pc-linux-gnu/lib
gisdbase=/home/mlennert/WWW/pywps/grassdata

pywps.cgi:

export PYWPS_CFG="/home/mlennert/WWW/pywps/pywps.cfg"
export PYWPS_PROCESSES="/home/mlennert/SRC/WPS_PROCESS"

and in WPS_PROCESSES I have all the files from your original
wps-grass-bridge svn directory:

GlobalGrassSettings.py
GlobalGrassSettings.pyc
GrassXMLtoPyWPS.py
GrassXMLtoYAML.py
GrassXMLtoZCFG.py
PyWPSGrassModuleStarter.py

the gms and wpsXML directories (I erased the zoo-related) and a long list of
grass modules descriptors, of which just the v.perturb one as example:

# ################################################ #
# This process was generated using GrassXMLtoPyWPS #
# Author: Soeren Gebbert #
# Mail: soerengebbert <at> googlemail <dot> com #
# ################################################ #

from pywps.Process import WPSProcess

from PyWPSGrassModuleStarter import PyWPSGrassModuleStarter

class v_perturb(WPSProcess):

def __init__(self):
WPSProcess.__init__(self, identifier = 'v.perturb', title = 'Random
location perturbations of vector points.', version = 1, statusSupported =
True, storeSupported = True, metadata = [{'type': 'simple', 'title':
'vector'}, {'type': 'simple', 'title': 'statistics'}], abstract =
'http://grass.osgeo.org/grass70/manuals/html70_user/v.perturb.html’)

# Literal and complex inputs
self.addComplexInput(identifier = 'input', title = 'Data source for
direct OGR access', minOccurs = 1, maxOccurs = 1, formats = [{'mimeType':
'text/xml', 'schema': 'http://schemas.opengis.net/gml/2.1.2/feature.xsd’,
'encoding': 'UTF-8'}, {'mimeType': 'text/xml', 'schema':
'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd’, 'encoding': 'UTF-8'},
{'mimeType': 'application/dgn', 'schema': 'None', 'encoding': 'None'},
{'mimeType': 'application/shp', 'schema': 'None', 'encoding': 'None'},
{'mimeType': 'application/x-zipped-shp', 'schema': 'None', 'encoding':
'None'}])
self.addLiteralInput(identifier = 'layer', title = 'A single vector map
can be connected to multiple database tables. This number determines which
table to use. Layer name for direct OGR access.', minOccurs = 1, maxOccurs =
1, type = type("string"), default = "-1")
self.addLiteralInput(identifier = 'distribution', title = 'Distribution
of perturbation', minOccurs = 0, maxOccurs = 1, type = type("string"),
default = "uniform", allowedValues = ['uniform', 'normal'])
self.addLiteralInput(identifier = 'parameters', title = 'If the
distribution is uniform, only one parameter, the maximum, is needed. For a
normal distribution, two parameters, the mean and standard deviation, are
required.', minOccurs = 1, maxOccurs = 1024, type = type(0.0), allowedValues
= '*')
self.addLiteralInput(identifier = 'minimum', title = 'Minimum deviation
in map units', minOccurs = 0, maxOccurs = 1, type = type(0.0), default =
0.0)
self.addLiteralInput(identifier = 'seed', title = 'Seed for random number
generation', minOccurs = 0, maxOccurs = 1, type = type(0), default = 0)

# complex outputs
self.addComplexOutput(identifier = 'output', title = 'Name for output
vector map', formats = [{'mimeType': 'text/xml', 'schema':
'http://schemas.opengis.net/gml/2.1.2/feature.xsd’, 'encoding': 'UTF-8'},
{'mimeType': 'text/xml', 'schema':
'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd’, 'encoding': 'UTF-8'}])

def execute(self):
starter = PyWPSGrassModuleStarter()
starter.fromPyWPS("v.perturb", self.inputs, self.outputs, self.pywps)

if __name__ == "__main__":
process = v_perturb()
process.execute()

Any ideas ?

Moritz

2011/4/14 Moritz Lennert<mlennert@club.worldonline.be>:

Soeren,

Thanks for the great work on WPS integration !

On 28/01/11 11:44, Soeren Gebbert wrote:

How to attach GRASS modules to PyWPS using the wps-grass-bridge is
documented here:
http://code.google.com/p/wps-grass-bridge/wiki/PyWPS_Integration

Well, the code isn't stable yet but it demonstrates the possibilities
of this approach.

I've tried following the above instructions, and the server does give a
correct answer for GetCapabilities. I can also see the list of
modules in
the QGIS WPS plugin and get the GUI of a module. However, once I run the
module I always get the following error, whatever the module I try:

<wps:ProcessFailed>
<wps:ExceptionReport>
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>argument 1 must be string or buffer,
not None</ows:ExceptionText>
</ows:Exception>
</wps:ExceptionReport>
</wps:ProcessFailed>

Any idea what could be wrong ? I can't find a way to see what URL the
QGIS
plugin sends to the server.

Moritz

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On 15/04/11 10:59, Soeren Gebbert wrote:

Hello Moritz,
the problem is the temporal GML file generation in qgswpstools.py.
This piece python code should solve the problem, which is also
included in the patch:

qgswpstools.py at line ~230

     # Check in case a ".g" was attached to the tempfile
     if os.path.isfile(tmpFile + ".g") == True:
       tmpFile = tmpFile + ".g"

Thanks for the patch !

- I set up a simple pywps instance with only two of the example processes from the pywps source code: ultimatequestionprocess and buffer. Without your patch buffer showed the same error message, but with your patch both run, but the buffer process gives completely wrong buffers (much too large - maybe it is working in degrees instead of meters, even though the QGIS project has units meters and the correct projection defined).

- Running the grass processes however gave me the same error message.

This was using grass7 trunk and qgis trunk.

- I've installed the Debian stable 1.4 version of QGIS.

- I set up a simple pywps instance with only two of the example processes from the source code: ultimatequestionprocess and buffer. Both run, but the buffer process gives completely wrong buffers (much too large - maybe it is working in degrees instead of meters, even though the QGIS project has units meters and the correct projection defined).

- Trying to run v.perturb or v.buffer without or with your patch applied gives me

                 <ows:Exception exceptionCode="NoApplicableCode">
                     <ows:ExceptionText>Failed to execute WPS process [v.perturb]: Unsupported MimeType: "text/xml". Unable to create input location from input ./pywpsInput0DORwt</ows:ExceptionText>
                 </ows:Exception>

I'm currently recompiling a fresh a fresh checkout from qgis trunk in order to test with that.

I'll keep you posted.

Moritz

Hi Moritz,
please use the latest pywps and wps-grass-bridge svn versions. Can you
please verify if the mime type and the schema of the input vector are
set in the WPS request generated by qgis? More below:

2011/4/15 Moritz Lennert <mlennert@club.worldonline.be>:

On 15/04/11 10:59, Soeren Gebbert wrote:

Hello Moritz,
the problem is the temporal GML file generation in qgswpstools.py.
This piece python code should solve the problem, which is also
included in the patch:

qgswpstools.py at line ~230

\# Check in case a &quot;\.g&quot; was attached to the tempfile
if os\.path\.isfile\(tmpFile \+ &quot;\.g&quot;\) == True:
  tmpFile = tmpFile \+ &quot;\.g&quot;

Thanks for the patch !

I hope it works correctly.

- Running the grass processes however gave me the same error message.

This was using grass7 trunk and qgis trunk.

- I've installed the Debian stable 1.4 version of QGIS.

- I set up a simple pywps instance with only two of the example processes
from the source code: ultimatequestionprocess and buffer. Both run, but the
buffer process gives completely wrong buffers (much too large - maybe it is
working in degrees instead of meters, even though the QGIS project has units
meters and the correct projection defined).

Unfortunately i am not familiar with the default processes of PyWPS.

- Trying to run v.perturb or v.buffer without or with your patch applied
gives me

           &lt;ows:Exception exceptionCode=&quot;NoApplicableCode&quot;&gt;
               &lt;ows:ExceptionText&gt;Failed to execute WPS process

[v.perturb]: Unsupported MimeType: "text/xml". Unable to create input
location from input ./pywpsInput0DORwt</ows:ExceptionText>
</ows:Exception>

This error is related to the wps-grass-bridge. It requires the
definition of the mime type and the schema in case of XML data to
identify GML or KML data. Because QGIS always produce GML this error
should not occur in case the mime types are set correctly in the
request. In case the request is correct the error is located in the
wps-grass-bridge and i can fix it in the latest svn version.

I'm currently recompiling a fresh a fresh checkout from qgis trunk in order
to test with that.

Thanks for your effort and testing. The main problem is that all
required software is in experimental state so the identification of
the problem is quite hard.

Best regards
Soeren

I'll keep you posted.

Moritz

On 15/04/11 12:56, Soeren Gebbert wrote:

Hi Moritz,
please use the latest pywps and wps-grass-bridge svn versions.

That seems to have solved it. I had used the install script for pywps, but this installed the FOSS4G2010 branch. Now I've installed the latest trunk and everything seems to work.

Sorry for the noise !

A few rapid remarks for future development from my first usage:

- Flags are all True by default. I think they should be False by default. I see that e.g. for v.buffer, the v_buffer.py process file contains:

self.addLiteralInput(identifier = '-s', title = 'Make outside corners straight', minOccurs = 0, maxOccurs = 1, type = type(True), default = False, allowedValues = [True, False])

so one would expect it to be False by default. This probably means that the problem is in the QGIS plugin, or ?

- It is not clear where the order of parameter in the GUI comes from: notably those that are not directly defined by the model (e.g. ns and ew resolution), but it would make for a better experience to have them more logically grouped.

- When running v.buffer, I get the following error:

                 <ows:Exception exceptionCode="NoApplicableCode">
                     <ows:ExceptionText>Failed to execute WPS process [v.buffer]: Error while executing the grass module. The following error message was logged:
Buffering lines...
2%...5%...etc
[snip]
Deleting boundaries...
    2%... 5%...etc
</ows:ExceptionText>
</ows:Exception>

So, it seems to catch all the output of G_percent and G_message and interpret it as an error...

- The WPS plugin shouldn't be modular, i.e. you should be able to use other commands with the plugin open (e.g. add another layer)

Once again, thanks for all the work and for your support !

Moritz

Hello Moritz,

2011/4/15 Moritz Lennert <mlennert@club.worldonline.be>:

On 15/04/11 12:56, Soeren Gebbert wrote:

Hi Moritz,
please use the latest pywps and wps-grass-bridge svn versions.

That seems to have solved it. I had used the install script for pywps, but
this installed the FOSS4G2010 branch. Now I've installed the latest trunk
and everything seems to work.

Sorry for the noise !

Thanks for testing this solution, feedback is very important!

A few rapid remarks for future development from my first usage:

- Flags are all True by default. I think they should be False by default. I
see that e.g. for v.buffer, the v_buffer.py process file contains:

self.addLiteralInput(identifier = '-s', title = 'Make outside corners
straight', minOccurs = 0, maxOccurs = 1, type = type(True), default = False,
allowedValues = [True, False])

so one would expect it to be False by default. This probably means that the
problem is in the QGIS plugin, or ?

- It is not clear where the order of parameter in the GUI comes from:
notably those that are not directly defined by the model (e.g. ns and ew
resolution), but it would make for a better experience to have them more
logically grouped.

When generating the GRASS module WPS XML process description and based
upon this the PyWPS processes i had in mind that for literal boolean
inputs "False" should be the default. And i had in mind that the input
order is adapted from the GRASS command line interface, i.e: the ns
and ew resolution as well as the band number are the last entries for
inputs. But the WPS server seems to have its own order logic (dicts?)
and i do not want to implement input/output ordering in QGIS plugin
because the logic of the order of is GRASS module specific.

- When running v.buffer, I get the following error:

           &lt;ows:Exception exceptionCode=&quot;NoApplicableCode&quot;&gt;
               &lt;ows:ExceptionText&gt;Failed to execute WPS process

[v.buffer]: Error while executing the grass module. The following error
message was logged:
Buffering lines...
2%...5%...etc
[snip]
Deleting boundaries...
2%... 5%...etc
</ows:ExceptionText>
</ows:Exception>

So, it seems to catch all the output of G_percent and G_message and
interpret it as an error...

This should not happen. In case a module does not run correctly
(decision is made based on the return value) and exception will be
raised and the stderr output of the module will be attached. Seems
like a bug in wps-grass-bridge to me.

- The WPS plugin shouldn't be modular, i.e. you should be able to use other
commands with the plugin open (e.g. add another layer)

Yes indeed, this is an important missing feature. There are many
features missing i.e: non blocking waiting for long running processes,
a status bar for long running processes, efficient vector data
handling, GUI enhancement, better text/plain output handling, better
error handling and so on ... . Unfortunately i am not a QGIS nor a QT4
programmer, so i do not have the knowledge to implement such important
features by myself, so any help is appreciated.

Best regards
Soeren

Once again, thanks for all the work and for your support !

Moritz