[Pywps-commits] r598 - trunk/pywps/processes

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Sep 16 11:28:50 CEST 2008


Author: jachym
Date: 2008-09-16 11:28:49 +0200 (Tue, 16 Sep 2008)
New Revision: 598

Added:
   trunk/pywps/processes/exampleBufferNoInputsProcess.py
Log:
added example buffer no data inputs process

Added: trunk/pywps/processes/exampleBufferNoInputsProcess.py
===================================================================
--- trunk/pywps/processes/exampleBufferNoInputsProcess.py	2008-09-16 09:27:15 UTC (rev 597)
+++ trunk/pywps/processes/exampleBufferNoInputsProcess.py	2008-09-16 09:28:49 UTC (rev 598)
@@ -0,0 +1,44 @@
+from pywps.Process.Process import WPSProcess
+ 
+ 
+class Process(WPSProcess):
+    """Main process class"""
+    def __init__(self):
+        """Process initialization"""
+ 
+        # init process
+        WPSProcess.__init__(self,
+            identifier = "exampleBufferNoInputsProcess",
+            title="BufferNoInputs",
+            version = "0.1",
+            storeSupported = "true",
+            statusSupported = "true",
+            abstract="Create a buffer around a fixed vector file",
+            grassLocation = "spearfish60")
+            #grassLocation = True)
+ 
+        self.bufferOut = self.addComplexOutput(identifier="buffer",
+                                title="Output buffer file")
+ 
+    def execute(self):
+        """Execute process.
+ 
+        Each command will be executed and output values will be set
+        """
+ 
+        # run some command from the command line
+        self.cmd("g.region -d")
+ 
+        # set status value
+ 
+        self.status.set("Buffering",50)
+        self.cmd("v.buffer input=roads output=roads_buff buffer=100 scale=1.0 tolerance=0.01")
+ 
+        self.status.set("Exporting data",90)
+        self.cmd("v.out.ogr type=area format=GML input=roads_buff dsn=out.xml  olayer=path.xml")
+ 
+        # set output values at the end
+        self.bufferOut.setValue("out.xml")
+
+        # everything was all right, return None
+        return



More information about the Pywps-commits mailing list