Nuovo processo che restituisce l'xml con tutti i percorsi
[alpinway.git] / processes / paths.py
blob7e71cd09d468cf80fd401300997dabbdfe8c2796
1 #!/usr/bin/python
3 # Author: Stepan Kafka
5 import os,time,string,sys,Gnuplot,re
6 from pywps.Process.Process import WPSProcess
8 class Process(WPSProcess):
9 def __init__(self):
10 WPSProcess.__init__(self,
11 identifier = "paths",
12 title="Paths stored",
13 abstract="Paths on the Trentino SAT network",
14 version = "0.2",
15 storeSupported = True,
16 statusSupported = True,
17 grassLocation="alpi")
18 self.los = self.addComplexOutput(identifier = "los",
19 title = "Resulting output map",
20 formats = [{"mimeType":"text/xml"}])
22 def execute(self):
23 self.cmd("g.mapset mapset=nico")
24 #:browse confirm saveas
25 self.cmd("g.region -d")
26 #self.cmd("g.region vect=allgpx")
27 self.status.set(msg="Region setted", percentDone=20)
28 self.cmd("v.out.ogr format=GML input=allgpx dsn=out.xml olayer=path.xml")
29 self.status.set(msg="Results saved", percentDone=80)
30 if "out.xml" in os.listdir(os.curdir):
31 self.los.setValue("out.xml")
32 return
33 else:
34 return "Output file not created"