From d03fbc1bfbf95dfe216a64e589852efe3ec1a7bd Mon Sep 17 00:00:00 2001 From: Nicola Manica Date: Wed, 14 Jan 2009 11:17:47 +0100 Subject: [PATCH] Nuovo processo che restituisce l'xml con tutti i percorsi --- processes/paths.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 processes/paths.py diff --git a/processes/paths.py b/processes/paths.py new file mode 100644 index 0000000..7e71cd0 --- /dev/null +++ b/processes/paths.py @@ -0,0 +1,36 @@ +#!/usr/bin/python + +# Author: Stepan Kafka + +import os,time,string,sys,Gnuplot,re +from pywps.Process.Process import WPSProcess + +class Process(WPSProcess): + def __init__(self): + WPSProcess.__init__(self, + identifier = "paths", + title="Paths stored", + abstract="Paths on the Trentino SAT network", + version = "0.2", + storeSupported = True, + statusSupported = True, + grassLocation="alpi") + self.los = self.addComplexOutput(identifier = "los", + title = "Resulting output map", + formats = [{"mimeType":"text/xml"}]) + + def execute(self): + self.cmd("g.mapset mapset=nico") + #:browse confirm saveas + self.cmd("g.region -d") + #self.cmd("g.region vect=allgpx") + self.status.set(msg="Region setted", percentDone=20) + self.cmd("v.out.ogr format=GML input=allgpx dsn=out.xml olayer=path.xml") + self.status.set(msg="Results saved", percentDone=80) + if "out.xml" in os.listdir(os.curdir): + self.los.setValue("out.xml") + return + else: + return "Output file not created" + + -- 2.11.4.GIT