[Pywps-devel] Problems with PyWPS/GRASS

Stephan Breisig stephan.breisig at gmx.de
Fri Jan 28 00:51:44 CET 2011


Hello,

for my master thesis I want to use GRASS via PyWPS. Unfortunatelly, this 
seems to be as problematic as one might expect for a Linux/GRASS/Python 
(almost) beginner like me. I hope you will not be too much annoyed with 
the quite long mail, but I think the more information you get the 
better! Here are the details:

What I use: Ubuntu 10.04.1, GRASS 6.4.0-2, Python 2.6.5, PyWPS 3.1.0 and 
Apache 2.2.14; WPS is run on localhost

My pywps.cgi wrapper script looks like this:

#! /bin/sh

export PYWPS_CFG=/usr/local/lib/python2.6/dist-packages/pywps/pywps.cfg
export 
PYWPS_PROCESSES=/usr/local/lib/python2.6/dist-packages/pywps/processes

export GISBASE=/usr/lib/grass64/
export GISDBASE=/home/stephanbreisig/grassdata/

export 
PATH=$PATH:/$GISBASE/bin:/$GISBASE/scripts:/$GISBASE/etc:/$GISBASE/lib:/usr/lib/python2.6:/$GISBASE/etc/python/grass:/$GISBASE/etc/python/grass/lib:/$GISBASE/etc/python/grass/script 

*#export GISRC=$HOME/.grassrc6 *

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib
export PYTHONPATH=$GISBASE/etc/python
export PYTHONLIB=/usr/lib/python2.6

export LOCATION_NAME=$GISDBASE/xy_unreferenziert
export GIS_LOCK=$$

/usr/local/bin/wps.py

And this is a simple test process causing problems:

#!usr/bin/env python

from pywps.Process.Process import WPSProcess
from types import *
*#import grass.script as grass*
import sys

class Process(WPSProcess):

def __init__(self):
    WPSProcess.__init__(self, identifier = "test", title = "csv to 
vectormap", storeSupported = "true", statusSupported = "true", 
grassLocation = "xy_unreferenziert")

def execute(self):
    testmap = *self.cmd*(["v.in.ascii", "-zt", 
"input=/var/www/testdaten.csv", "output=testmap", "fs=','", "x=1", 
"y=2", "z=3", "cat=3"])
    return

I can only get any reasonable results (for example just a correct output 
for g.version) when I use self.cmd() instead of GRASSpython scripting 
library commands in the process and when GISRC is commented out in 
pywps.cgi.
The output for the process above on firefox actually looks fine (no 
error messsages, process successful), nevertheless in the GRASS location 
specified in the process 
(/home/stephanbreisig/grassdata/xy_unreferenziert/) there is just the 
PERMANENT mapset as before and nothing else has happened. Browsing the 
documentations and wikis etc. for GRASS and PyWPS (especially regarding 
environment variables) turned out to be of little help.

Many thanks in advance for your help!

Best regards,

Stephan Breisig







-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wald.intevation.org/pipermail/pywps-devel/attachments/20110128/2edc57ff/attachment.htm
-------------- next part --------------
Überprüft mit AntiVir MailGuard  v10.0.1.38 AVE 8.2.4.150 VDF 7.11.2.16


More information about the Pywps-devel mailing list