Upload
jachym-cepicky
View
295
Download
0
Tags:
Embed Size (px)
Citation preview
PyWPS – Project status and demo
Jachym Cepicky1
1Geosense s.r.o. http://geosense.cz
WPS Workshop
Jachym Cepicky
ForesterOpenSource GIS developer (formeruser) - GRASS, OpenLayers, PyWPS,. . .Member of Board of directors of OpenSource Geospatial Foundation(OSGeo.org)@jachymc http://les-ejk.czhttp://www.openstreetmap.org/user/jachymc
TOC
1 About PyWPS
2 Code
3 PyWPS 4
What is PyWPS
OGC WPS on the ServerSince 2006Pythonhttp://pywps.wald.intevation.org
http://github.org/geopython/pywps
PyWPS - what it is NOT
PyWPS is no analytical tool or engine. It does not performany type of geospatial calculation.PyWPS is not special XML parser or generator. It does notvalidate your GMLs against given schemas (yet), it doesnot build GML from Python objects.It is not complicated
PyWPS - what it is NOT
PyWPS is no analytical tool or engine. It does not performany type of geospatial calculation.PyWPS is not special XML parser or generator. It does notvalidate your GMLs against given schemas (yet), it doesnot build GML from Python objects.It is not complicated
PyWPS - what it is NOT
PyWPS is no analytical tool or engine. It does not performany type of geospatial calculation.PyWPS is not special XML parser or generator. It does notvalidate your GMLs against given schemas (yet), it doesnot build GML from Python objects.It is not complicated
Keywords
Keywords
rather bike, then a car
Keywords
#small
Keywords
#modular
Keywords
#fast
Keywords
#easy
Keywords
#slick
Keywords
#accessories (GRASS, GDAL, Shapely, #python)
History of PyWPS
2006-11-10 version 1.0.0 Web User Interface for WPS(Embrio).
2007-10-08 version 2.0.0 New version improved stability,Process class, OpenLayers 2.x.
2008-11-06 version 3.0.0 New code structure, implementationof WPS 1.0.0
2009-06-01 version 3.1.0 New generic JavaScript WPS Clientlibrary and more.
2011-09-06 version 3.2.0 MapServer2013 Moved to GitHub
http://github.com/geopython/pywps
2013-5 FOSS4G-CEE 2013, Bucharest, Started to workon PyWPS-4
How does it work
Time machine / climate change model
How does it work
Internet, sharing
How does it work
How does it work
How does it work
How does it work
One process
How does it work
Two processes
How does it work
Process chain
TOC
1 About PyWPS
2 Code
3 PyWPS 4
Talk is cheap. Show me the code
1 from pywps.Process import WPSProcess2 from osgeo import ogr3 import types4 [...]5 WPSProcess.__init__(self,6 identifier = "ogrbuffer", # must be same, as filename7 title="Buffer process using OGR")8 [...]9 self.data = self.addComplexInput(identifier = "data")10 self.size = self.addLiteralInput(identifier="size")11 self.output =self.addComplexOutput(identifier="buffer")
Talk is cheap. Show me the code
1 from pywps.Process import WPSProcess2 from osgeo import ogr3 import types4 [...]5 WPSProcess.__init__(self,6 identifier = "ogrbuffer", # must be same, as filename7 title="Buffer process using OGR")8 [...]9 self.data = self.addComplexInput(identifier = "data")10 self.size = self.addLiteralInput(identifier="size")11 self.output =self.addComplexOutput(identifier="buffer")
Talk is cheap. Show me the code
1 from pywps.Process import WPSProcess2 from osgeo import ogr3 import types4 [...]5 WPSProcess.__init__(self,6 identifier = "ogrbuffer", # must be same, as filename7 title="Buffer process using OGR")8 [...]9 self.data = self.addComplexInput(identifier = "data")10 self.size = self.addLiteralInput(identifier="size")11 self.output =self.addComplexOutput(identifier="buffer")
Talk is cheap. Show me the code
10 def execute(self):1112 inSource = ogr.Open(self.data.getValue())13 inLayer = inSource.GetLayer()1415 [...]16 outLayer = outSource.CreateLayer(17 out,None,ogr.wkbUnknown)1819 [...]
20 while index < featureCount:21 self.status.set("Calculating buffer for feature %d from %d" % (index+1,featureCount),22 (100*(index+1)/featureCount*1.0))23 [...]24 inGeometry = inFeature.GetGeometryRef()2526 # make the buffer27 buff = inGeometry.Buffer(float(self.size.getValue()))2829 [...]30 self.output.setValue(out)31 return
Talk is cheap. Show me the code
10 def execute(self):1112 inSource = ogr.Open(self.data.getValue())13 inLayer = inSource.GetLayer()1415 [...]16 outLayer = outSource.CreateLayer(17 out,None,ogr.wkbUnknown)1819 [...]
20 while index < featureCount:21 self.status.set("Calculating buffer for feature %d from %d" % (index+1,featureCount),22 (100*(index+1)/featureCount*1.0))23 [...]24 inGeometry = inFeature.GetGeometryRef()2526 # make the buffer27 buff = inGeometry.Buffer(float(self.size.getValue()))2829 [...]30 self.output.setValue(out)31 return
What can be connected
Python* (GDAL/OGR, GRASS, MapServer, Shapely, Fiona, R, PostGIS, . . . )
Jython - Java* (GeoTools, JTS, GeoServer, . . . )
Any batch file
Tools, which are tested with PyWPS
GRASS (GRASS-WPS interface, Soren Gebert)
R
Taverna (WPS-WSDL orchestration, Jorge de Jesus)
MapServer (output generation using OGC OWS, still concept)
TOC
1 About PyWPS
2 Code
3 PyWPS 4
Bright future
Started from scratch
Use Python 2.7 (for future 3.0 migration)
Try different interpreters of Python (pypy)
Easy parsing with lxml
Prepare for next WPS version
Change of the whole process concept
PyWPS 4
#geopython 2006
PyWPS 4
#geopython 2013
lxml http://lxml.org
GRASS-WPS, GRASS-Python
Werkzeug http://werkzeug.pocoo.org/
Python 3
Django
MapServer for output generation
Respect to new OGC WPS 2.0.0 features
. . .
Happy processing!
[email protected]://les-ejk.cz@jachymc
http://github.org/jachym/pywps-4http://pywps.wald.intevation.org