Skip to content

GeoPython conference 2016

Jonas Eberle edited this page Mar 10, 2016 · 5 revisions

The new PyWPS-4: your Python based WPS server

PyWPS is an open source, light-weight, Python based, implementation of the OGC Web Processing Service (WPS) standard. It provides users with a relatively seamless environment where to code geo-spatial functions and models that are readily exposed to the internet through the WWW.

PyWPS resulted initially from a project to connect GRASS with UMN MapServer, started in 2006 by Jachym Cepicky as part of a scholarship funded by GDF-Hannover. PyWPS was publicly presented at the 2006 FOSS4G conference as a means to expose GRASS to the web. Soon after, Intevation GmbH hosted the first project website, code repository and mailing lists, seeding a full fledged open source development ecossystem. Version 1 of PyWPS was released in November of 2006.

Version 2 was released in late 2007, implementing further features of the WPS standard and introducing the Process class, greatly improving the object-oriented process development. A year later PyWPS 3.0 was released, featuring a new code structure and implementing the WPS 1.0 standard almost entirely; by this time stability had also greatly improved.

Discussions on a new version of PyWPS started in 2013, with a draft code structure developed still that year. In 2014 the Luxembourg Institute of Science and Technology (LIST) held a workshop on the WPS standard where the new code concept was further advanced. Throughout 2015 LIST hosted an internship during which much of the PyWPS-4 core code was developed. During this time test sessions with potential users were also conducted.

PyWPS-4 is complete re-write of the core code, taking advantage of the state-of-the-art Python infrastructure in order to provide new and useful features. The recent publication of WPS version 2.0 - which brings forth important new functionalities - is also prompting this re-structuring of the code.

PyWPS-4 is a WSGI application, independent from the server implementation; an abstract Server class is provided to the user (process developer), serving as a bridge with the WSGI server. The PyWPS core code structure is now completely unbundled from the functionality of services and processes.

PyWPS-4 is already able to parse POST and GET request against the WPS schema, it offers storage mechanisms for process inputs and outputs and spawns processes to the background for asynchronous execution requests. It introduces safe validation of data inputs, based on common libraries and XML schemas. Among the Python libraries used are lxml - for XML parsing - and Multiprocessing - for asynchronous execution.

Future goals of the project include automatic publication of geo-spatial results through a WFS/WCS server such as MapServer and support for Transactional WPS with a process scheduler. Implementing the new process Pause and Delete instructions introduced with the WPS 2.0 standard is also a goal for future releases (likely PyWPS 4.2).

PyWPS offers a straightforward WPS development framework with the increasingly popular Python language. Easy to learn, but versatile enough to support object-oriented paradigms, Python is as appropriate for users lacking formal training in programming as for professional programmers. Python also offers easy access to a vast array of code libraries, in particular those for geo-spatial data manipulation, e.g. GRASS, GDAL/OGR, Fiona, Shapely, etc., but also to statistics packages (e.g. rpy2 for R statistics) and data analysis tools (e.g. pandas). The Python language also facilitates the extension/adaptation of PyWPS to user specific or projects specific requirements.