FAQ

FAQ

General questions

Error codes hints


General answares

Which version of PyWPS should I use?
Currently, you should use the latest stable version. Older versions (1.0.0) are really outdated and you should better not use them.
How to debug PyWPS processes?
You have two possibilities:
  • Run PyWPS from command line directly from command line:
    jachym@mellon:~$ ./wps.py "&service=wps&version=0.4.0&request=execute&datainputs=input1,value1,input2,value2,..."
                                
    
  • See error log file from your web server. I use program tail:
    jachym@mellon:$ tail -f /var/log/apache/error.log |sed -e "s/\[.*\] //g"
    PyWPS GCmd: r.rescale out=kat_dop_k_2004_1188372842 in=dop_k_2004_1188372842 to=0,255
    to kat_dop_k_2004_1188372842[0,255]
    
    PyWPS GCmd: r.support map=dop_k_2004_1188372842 title="drasil2" >&2
    to kat_dop_k_2004_1188372842[0,255]
    
    PyWPS GCmd: r.support map=kat_dop_k_2004_1188372842 title="drasil2" >&2
    to kat_dop_k_2004_1188372842[0,255]
    
    PyWPS ERROR: Could not perform command: r.support map=kat_dop_k_2004_1188372842 title="drasil2" >&2 in process K2O, method execute()
    /home/bnhelp/pfwps/wps.py:79: DeprecationWarning: Non-ASCII character '\xc2' in file /usr/home/bnhelp/pfwps/pywps/processes/pf_interpolate_grass.py on line 51, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
      from pywps.processes import *
    PyWPS GCmd: g.region rast=mask2004@medlov res=5 1>&2
    
    ....
    
                                
    
How to run command line commands?
Use build-in method Cmd(string):
                        self.Cmd("ogr2ogr .... ")
                
How to run GRASS commands?
Use build-in method GCmd(string):

                        self.GCmd("r.surf.rst in=%s elev=dem" % (self.GetInputValue("dem")))
                
Where can I find documentation to process writing in general?
Try this sources of documentation:
  • doc directory in PyWPS source code. The best file for you is pywps-howto.pdf. Also some examples are there.
  • pydoc command to command.py module
                                cd pywps/Wps
                                pydoc process.py
                            
    
  • There are example processes in pywps/processes/ directory. Try to modify them to your needs.
Why do I have to rename processes/__init__.py-dist and other files to __init__.py?

The files

  • processes/__init__.py
  • etc/setup.py
  • etc/grass.py
do have -dist suffix. You have to rename them and remove this suffix from the file name (e.g. processes/__init__.py-dist -> processes/__init__.py) in order to get PyWPS running and configured.

Why this? If you make some change to this files (by tuning PyWPS), and later you would update your installation of PyWPS, this original files will be overwritten. In this case, only the "-dist" will be overwritten and your changes should be save.


Error code hints

The process seems not to exist (InvalidParametrValue code).
Try this:
  • Is the project listed in GetCapabilities responce?
  • Is the project registerd in pywps/processes/__init__.py file?
The process returns ERROR: G_malloc: out of memory.
You have to setup GRASS region, while operating with raster maps.
                        self.GCmd("g.region rast=input_map")
                    
or
                        self.GCmd("g.region -d")