PyWPS – Project status and demo
ˇ
´
Jachym Cepick´ 1
y
1 Geosense

s.r.o. http://geosense.cz

WPS Workshop
Jachym Cepicky

Forester
OpenSource GIS developer (former
user) - GRASS, OpenLayers, PyWPS,
...
Member of Board of directo...
TOC

1

About PyWPS

2

Code

3

PyWPS 4
What is PyWPS

OGC WPS on the Server
Since 2006
Python
http://pywps.wald.intevation.org
http://github.org/geopython/pywps
PyWPS - what it is NOT

PyWPS is no analytical tool or engine. It does not perform
any type of geospatial calculation.
PyW...
PyWPS - what it is NOT

PyWPS is no analytical tool or engine. It does not perform
any type of geospatial calculation.
PyW...
PyWPS - what it is NOT

PyWPS is no analytical tool or engine. It does not perform
any type of geospatial calculation.
PyW...
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 improv...
How does it work
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 WPSProcess
2 from osgeo import ogr
3 import types
4 [...]
5
W...
Talk is cheap. Show me the code

1 from pywps.Process import WPSProcess
2 from osgeo import ogr
3 import types
4 [...]
5
W...
Talk is cheap. Show me the code

1 from pywps.Process import WPSProcess
2 from osgeo import ogr
3 import types
4 [...]
5
W...
Talk is cheap. Show me the code
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

def execute(self):
inSo...
Talk is cheap. Show me the code
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

def execute(self):
inSo...
What can be connected

Python* (GDAL/OGR, GRASS, MapServer, Shapely, Fiona, R, PostGIS, . . . )
Jython - Java* (GeoTools, ...
Tools, which are tested with PyWPS

¨
GRASS (GRASS-WPS interface, Soren Gebert)
R
Taverna (WPS-WSDL orchestration, Jorge d...
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)
...
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 gene...
Happy processing!
jachym.cepicky@gmail.com
http://les-ejk.cz
@jachymc
http://github.org/jachym/pywps-4
http://pywps.wald.i...
Upcoming SlideShare
Loading in …5
×

PyWPS at COST WPS Workshop

702 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
702
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

PyWPS at COST WPS Workshop

  1. 1. PyWPS – Project status and demo ˇ ´ Jachym Cepick´ 1 y 1 Geosense s.r.o. http://geosense.cz WPS Workshop
  2. 2. Jachym Cepicky Forester OpenSource GIS developer (former user) - GRASS, OpenLayers, PyWPS, ... Member of Board of directors of Open Source Geospatial Foundation (OSGeo.org) @jachymc http://les-ejk.cz http://www.openstreetmap.org/user/jachymc
  3. 3. TOC 1 About PyWPS 2 Code 3 PyWPS 4
  4. 4. What is PyWPS OGC WPS on the Server Since 2006 Python http://pywps.wald.intevation.org http://github.org/geopython/pywps
  5. 5. PyWPS - what it is NOT PyWPS is no analytical tool or engine. It does not perform any type of geospatial calculation. PyWPS is not special XML parser or generator. It does not validate your GMLs against given schemas (yet), it does not build GML from Python objects. It is not complicated
  6. 6. PyWPS - what it is NOT PyWPS is no analytical tool or engine. It does not perform any type of geospatial calculation. PyWPS is not special XML parser or generator. It does not validate your GMLs against given schemas (yet), it does not build GML from Python objects. It is not complicated
  7. 7. PyWPS - what it is NOT PyWPS is no analytical tool or engine. It does not perform any type of geospatial calculation. PyWPS is not special XML parser or generator. It does not validate your GMLs against given schemas (yet), it does not build GML from Python objects. It is not complicated
  8. 8. Keywords
  9. 9. Keywords rather bike, then a car
  10. 10. Keywords #small
  11. 11. Keywords #modular
  12. 12. Keywords #fast
  13. 13. Keywords #easy
  14. 14. Keywords #slick
  15. 15. Keywords #accessories (GRASS, GDAL, Shapely, #python)
  16. 16. 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, implementation of WPS 1.0.0 2009-06-01 version 3.1.0 New generic JavaScript WPS Client library and more. 2011-09-06 version 3.2.0 MapServer 2013 Moved to GitHub http://github.com/geopython/pywps 2013-5 FOSS4G-CEE 2013, Bucharest, Started to work on PyWPS-4
  17. 17. How does it work
  18. 18. How does it work Internet, sharing
  19. 19. How does it work
  20. 20. How does it work
  21. 21. How does it work
  22. 22. How does it work One process
  23. 23. How does it work Two processes
  24. 24. How does it work Process chain
  25. 25. TOC 1 About PyWPS 2 Code 3 PyWPS 4
  26. 26. Talk is cheap. Show me the code 1 from pywps.Process import WPSProcess 2 from osgeo import ogr 3 import types 4 [...] 5 WPSProcess.__init__(self, 6 identifier = "ogrbuffer", # must be same, as filename 7 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")
  27. 27. Talk is cheap. Show me the code 1 from pywps.Process import WPSProcess 2 from osgeo import ogr 3 import types 4 [...] 5 WPSProcess.__init__(self, 6 identifier = "ogrbuffer", # must be same, as filename 7 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")
  28. 28. Talk is cheap. Show me the code 1 from pywps.Process import WPSProcess 2 from osgeo import ogr 3 import types 4 [...] 5 WPSProcess.__init__(self, 6 identifier = "ogrbuffer", # must be same, as filename 7 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")
  29. 29. Talk is cheap. Show me the code 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 def execute(self): inSource = ogr.Open(self.data.getValue()) inLayer = inSource.GetLayer() [...] outLayer = outSource.CreateLayer( out,None,ogr.wkbUnknown) [...] while index < featureCount: self.status.set("Calculating buffer for feature %d from %d (100*(index+1)/featureCount*1.0)) [...] inGeometry = inFeature.GetGeometryRef() # make the buffer buff = inGeometry.Buffer(float(self.size.getValue())) [...] self.output.setValue(out) return
  30. 30. Talk is cheap. Show me the code 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 def execute(self): inSource = ogr.Open(self.data.getValue()) inLayer = inSource.GetLayer() [...] outLayer = outSource.CreateLayer( out,None,ogr.wkbUnknown) [...] while index < featureCount: self.status.set("Calculating buffer for feature %d from %d (100*(index+1)/featureCount*1.0)) [...] inGeometry = inFeature.GetGeometryRef() # make the buffer buff = inGeometry.Buffer(float(self.size.getValue())) [...] self.output.setValue(out) return
  31. 31. What can be connected Python* (GDAL/OGR, GRASS, MapServer, Shapely, Fiona, R, PostGIS, . . . ) Jython - Java* (GeoTools, JTS, GeoServer, . . . ) Any batch file
  32. 32. 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)
  33. 33. TOC 1 About PyWPS 2 Code 3 PyWPS 4
  34. 34. 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
  35. 35. PyWPS 4 #geopython 2006
  36. 36. PyWPS 4 #geopython 2013
  37. 37. 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 ...
  38. 38. Happy processing! jachym.cepicky@gmail.com http://les-ejk.cz @jachymc http://github.org/jachym/pywps-4 http://pywps.wald.intevation.org

×