├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── __init__.py ├── filters ├── PyWPS │ ├── AUTHORS │ ├── ChangeLog │ ├── INSTALL │ ├── LICENSE │ ├── MANIFEST.in │ ├── README │ ├── RELEASE.howto │ ├── SUBMITTING │ ├── TODO │ ├── debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── dirs │ │ ├── docs │ │ ├── files │ │ ├── pywps.1 │ │ ├── pywps.doc-base │ │ ├── pywps.postinst │ │ ├── pywps.postinst.debhelper │ │ ├── pywps.prerm │ │ ├── pywps.prerm.debhelper │ │ ├── pywps.substvars │ │ └── rules │ ├── doc │ │ ├── Makefile │ │ ├── README │ │ ├── make.bat │ │ └── source │ │ │ ├── _static │ │ │ └── pywps.png │ │ │ ├── _templates │ │ │ └── layout.html │ │ │ ├── api │ │ │ ├── Exceptions.rst │ │ │ ├── Grass.rst │ │ │ ├── Parser │ │ │ │ ├── DescribeProcess.rst │ │ │ │ ├── Execute.rst │ │ │ │ ├── GetCapabilities.rst │ │ │ │ └── index.rst │ │ │ ├── Process │ │ │ │ ├── InAndOutputs.rst │ │ │ │ ├── Lang.rst │ │ │ │ └── index.rst │ │ │ ├── Soap.rst │ │ │ ├── Template.rst │ │ │ ├── Wps │ │ │ │ ├── DescribeProcess.rst │ │ │ │ ├── Execute.rst │ │ │ │ ├── GetCapabilities.rst │ │ │ │ └── index.rst │ │ │ └── index.rst │ │ │ ├── clients │ │ │ ├── index.rst │ │ │ └── javascript.rst │ │ │ ├── conf.py │ │ │ ├── configuration │ │ │ └── index.rst │ │ │ ├── index.rst │ │ │ ├── installation │ │ │ └── index.rst │ │ │ ├── process │ │ │ ├── execute.rst │ │ │ ├── index.rst │ │ │ ├── puts.rst │ │ │ └── structure.rst │ │ │ ├── special │ │ │ ├── grass.rst │ │ │ ├── index.rst │ │ │ ├── mapserver.rst │ │ │ ├── mod_python.rst │ │ │ └── wsgi.rst │ │ │ └── testing │ │ │ └── index.rst │ ├── pywps │ │ ├── Exceptions.py │ │ ├── Ftp.py │ │ ├── Grass.py │ │ ├── Parser │ │ │ ├── DescribeProcess.py │ │ │ ├── Execute.py │ │ │ ├── Get.py │ │ │ ├── GetCapabilities.py │ │ │ ├── Post.py │ │ │ └── __init__.py │ │ ├── Process │ │ │ ├── InAndOutputs.py │ │ │ ├── Lang.py │ │ │ ├── Process.py │ │ │ └── __init__.py │ │ ├── Soap.py │ │ ├── Template.py │ │ ├── Templates │ │ │ ├── 1_0_0 │ │ │ │ ├── DescribeProcess.tmpl │ │ │ │ ├── DescribeProcess.tmplc │ │ │ │ ├── Execute.tmpl │ │ │ │ ├── Execute.tmplc │ │ │ │ ├── GetCapabilities.tmpl │ │ │ │ ├── GetCapabilities.tmplc │ │ │ │ ├── __init__.py │ │ │ │ └── inc │ │ │ │ │ ├── DescribeProcess_BoundingBoxValue.tmpl │ │ │ │ │ ├── DescribeProcess_ComplexValue.tmpl │ │ │ │ │ ├── DescribeProcess_LiteralValue.tmpl │ │ │ │ │ ├── Execute_Data_Inputs.tmpl │ │ │ │ │ ├── Execute_Data_Outputs.tmpl │ │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ ├── Wps │ │ │ ├── DescribeProcess.py │ │ │ ├── Execute │ │ │ │ ├── QGIS.py │ │ │ │ ├── UMN.py │ │ │ │ └── __init__.py │ │ │ ├── GetCapabilities.py │ │ │ ├── Wsdl.py │ │ │ └── __init__.py │ │ ├── XSLT │ │ │ ├── SOAP2WPS.xsl │ │ │ ├── WPS2SOAP.xsl │ │ │ ├── __init__.py │ │ │ └── describeProcess2WSDL.xsl │ │ ├── __init__.py │ │ ├── buffer.cfg │ │ ├── config.py │ │ ├── default.cfg │ │ ├── etc │ │ │ └── pywps.cfg-template │ │ ├── processes │ │ │ ├── README │ │ │ ├── __init__.py │ │ │ ├── dummyprocess.py │ │ │ ├── moreInOne.py │ │ │ ├── moreInstancesInOne.py │ │ │ ├── tests.py │ │ │ └── ultimatequestionprocess.py │ │ └── response.py │ ├── rpm │ │ ├── pywps.changes │ │ └── pywps.spec │ ├── setup.py │ ├── tests │ │ ├── Templates │ │ │ ├── 1_0_0 │ │ │ │ ├── DescribeProcess.tmpl │ │ │ │ ├── Execute.tmpl │ │ │ │ ├── GetCapabilities.tmpl │ │ │ │ ├── Wsdl.tmpl │ │ │ │ ├── __init__.py │ │ │ │ └── inc │ │ │ │ │ ├── DescribeProcess_BoundingBoxValue.tmpl │ │ │ │ │ ├── DescribeProcess_ComplexValue.tmpl │ │ │ │ │ ├── DescribeProcess_LiteralValue.tmpl │ │ │ │ │ ├── Execute_Data_Inputs.tmpl │ │ │ │ │ ├── Execute_Data_Outputs.tmpl │ │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ ├── benchmark.py │ │ ├── datainputs │ │ │ ├── dem.base64 │ │ │ ├── dem.tiff │ │ │ ├── lakes.gfs │ │ │ └── lakes.gml │ │ ├── envvars_tests.py │ │ ├── exception.py │ │ ├── exceptions.py │ │ ├── parser.py │ │ ├── perform_requests.py │ │ ├── process_inits.py │ │ ├── processes │ │ │ ├── __init__.py │ │ │ ├── buffer.py │ │ │ ├── dummyprocess.py │ │ │ ├── moreInOne.py │ │ │ ├── moreInstancesInOne.py │ │ │ ├── returner.py │ │ │ ├── tests.py │ │ │ └── ultimatequestionprocess.py │ │ ├── requests │ │ │ ├── HTTP_GET.txt │ │ │ ├── wps_describeprocess_exception_SOAP11.xml │ │ │ ├── wps_describeprocess_exception_SOAP12.xml │ │ │ ├── wps_describeprocess_request.xml │ │ │ ├── wps_describeprocess_request_SOAP11RPC.xml │ │ │ ├── wps_describeprocess_request_all.xml │ │ │ ├── wps_describeprocess_request_all_SOAP.xml │ │ │ ├── wps_describeprocess_request_dummyprocess.xml │ │ │ ├── wps_execute_request-base64.xml │ │ │ ├── wps_execute_request-bbox.xml │ │ │ ├── wps_execute_request-complexinput-as-reference.xml │ │ │ ├── wps_execute_request-complexinput-direct-rawdata-output.xml │ │ │ ├── wps_execute_request-complexinput-direct.xml │ │ │ ├── wps_execute_request-complexinput-one-output-as-reference.xml │ │ │ ├── wps_execute_request-complexinput-output-as-reference.xml │ │ │ ├── wps_execute_request-literalinput-responsedocument.xml │ │ │ ├── wps_execute_request-literalinput.xml │ │ │ ├── wps_execute_request-noinputs.xml │ │ │ ├── wps_execute_request-rawdataoutput.xml │ │ │ ├── wps_execute_request-responsedocument.xml │ │ │ ├── wps_execute_request_compress_SOAP.xml │ │ │ ├── wps_execute_request_flags_compress_SOAP.xml │ │ │ ├── wps_execute_request_lineage.xml │ │ │ ├── wps_execute_request_reference_lineage.xml │ │ │ ├── wps_execute_request_ultimate_compress_SOAP.xml │ │ │ ├── wps_execute_request_ultimatequestion_SOAP.xml │ │ │ ├── wps_getcapabilities_request.xml │ │ │ ├── wps_getcapabilities_request_SOAP11.xml │ │ │ ├── wps_getcapabilities_request_SOAP11RPC.xml │ │ │ └── wps_getcapabilities_request_SOAP12.xml │ │ ├── schema_validation.py │ │ └── soap_tests.py │ ├── webclient │ │ ├── 01-init.html │ │ ├── 02-describe.html │ │ ├── 03-execute.html │ │ ├── 04-execute-automatic.html │ │ └── WPS.js │ ├── webservices │ │ ├── cgi │ │ │ └── pywps.cgi │ │ ├── mod_python │ │ │ ├── .htaccess │ │ │ └── wps.py │ │ ├── tomcat │ │ │ ├── PywpsServlet.py │ │ │ └── web.xml │ │ └── wsgi │ │ │ └── wsgiwps.py │ └── wps.py ├── __init__.py ├── schemas │ ├── geojson │ │ ├── schema-geojson-line.json │ │ ├── schema-geojson-point.json │ │ ├── schema-geojson-polygon.json │ │ └── schema-geojson.json │ └── gml │ │ └── 2.1.2 │ │ ├── feature-line.xsd │ │ ├── feature-point.xsd │ │ ├── feature-polygon.xsd │ │ └── feature.xsd └── wpsFilter.py ├── help ├── Makefile ├── make.bat └── source │ ├── conf.py │ └── index.rst ├── i18n └── af.ts ├── icon.png ├── local_server.py ├── metadata.txt ├── pb_tool.cfg ├── plugin_upload.py ├── pylintrc ├── resources.py ├── resources.qrc ├── scripts ├── compile-strings.sh ├── run-env-linux.sh └── update-strings.sh ├── test ├── __init__.py ├── qgis_interface.py ├── tenbytenraster.asc ├── tenbytenraster.asc.aux.xml ├── tenbytenraster.keywords ├── tenbytenraster.lic ├── tenbytenraster.prj ├── tenbytenraster.qml ├── test_init.py ├── test_qgis_environment.py ├── test_resources.py ├── test_translations.py ├── test_wps4server_dialog.py └── utilities.py ├── wps4server.py ├── wps4serverServer.py ├── wps4server_dialog.py └── wps4server_dialog_base.ui /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | 3 | # C extensions 4 | *.so 5 | 6 | # Packages 7 | *.egg 8 | *.egg-info 9 | dist 10 | build 11 | eggs 12 | parts 13 | bin 14 | var 15 | sdist 16 | develop-eggs 17 | .installed.cfg 18 | lib 19 | lib64 20 | 21 | # Installer logs 22 | pip-log.txt 23 | 24 | # Unit test / coverage reports 25 | .coverage 26 | .tox 27 | nosetests.xml 28 | 29 | # Translations 30 | *.mo 31 | 32 | # Mr Developer 33 | .mr.developer.cfg 34 | .project 35 | .pydevproject 36 | 37 | *.orig 38 | *.rej 39 | *~ 40 | *.o 41 | *.swp 42 | *.pyc 43 | *.DS_Store 44 | 45 | 46 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | /*************************************************************************** 4 | wps4server: A QGIS Server plugin to add OGC Web Processing Service 5 | capabilities 6 | --------------------- 7 | Date : August 2015 8 | copyright : (C) 2015 by DHONT René-Luc - 3Liz 9 | email : rldhont@3liz.com 10 | ***************************************************************************/ 11 | 12 | /*************************************************************************** 13 | * * 14 | * This program is free software; you can redistribute it and/or modify * 15 | * it under the terms of the GNU General Public License as published by * 16 | * the Free Software Foundation; either version 2 of the License, or * 17 | * (at your option) any later version. * 18 | * * 19 | ***************************************************************************/ 20 | This script initializes the plugin, making it known to QGIS and QGIS Server. 21 | """ 22 | 23 | 24 | # noinspection PyPep8Naming 25 | def classFactory(iface): # pylint: disable=invalid-name 26 | """Load wps4server class from file wps4server. 27 | 28 | :param iface: A QGIS interface instance. 29 | :type iface: QgsInterface 30 | """ 31 | # 32 | from .wps4server import wps4server 33 | return wps4server(iface) 34 | 35 | 36 | def serverClassFactory(serverIface): # pylint: disable=invalid-name 37 | """Load wps4serverServer class from file wps4server. 38 | 39 | :param iface: A QGIS Server interface instance. 40 | :type iface: QgsServerInterface 41 | """ 42 | # 43 | from .wps4serverServer import wps4serverServer 44 | return wps4serverServer(serverIface) 45 | -------------------------------------------------------------------------------- /filters/PyWPS/AUTHORS: -------------------------------------------------------------------------------- 1 | Lorenzo Becchi - ominiverdi 2 | lorenzo at ominiverdi com 3 | 4 | Luca Casagrande - doktoreas 5 | luca.casagrande at gmail com 6 | 7 | Jachym Cepicky - jachym 8 | jachym.cepicky at centrum cz 9 | 10 | Stepan Kafka - stepan 11 | kafka at email cz 12 | 13 | Panagiotis Skintzos - pana 14 | p at pskintzos net 15 | 16 | 17 | Jorge de Jesus - jorgejesus 18 | jorge.jesus@gmail.com 19 | 20 | and others, see 21 | 22 | 23 | 24 | http://wald.intevation.org/project/memberlist.php?group_id=22 25 | -------------------------------------------------------------------------------- /filters/PyWPS/ChangeLog: -------------------------------------------------------------------------------- 1 | 2011-09-09 Jachym cepicky 2 | PyWPS 3.2.1 3 | New Stable release 4 | 5 | - Fix for UMN MapServer support (vector data) 6 | - Fix for Java 7 | - Fix for asynchronous mode 8 | - Fix in tests for python 2.7 9 | 10 | NOTE: MapServer will need further work 11 | 12 | 2011-09-06 Jachym Cepicky 13 | PyWPS 3.2.0 14 | New stable release 15 | 16 | - Updated JavaScript client (Which is going to be developed right now by me as well for some other project) 17 | - Introduced base64 data input and output encoding 18 | - Basic support for UMN MapServer, which generates OGC WFS and WCS services on top of resulting data 19 | - Documentation updates (API and workshops) 20 | - mod_python possible 21 | - Jython possible (pywps can run as Java servlet) 22 | - Tested with GRASS Bridge from Sören 23 | - Tests, tests, tests (and more will come soon) 24 | - setup.py fixed 25 | - logging using pythonish logging 26 | 27 | 2009-06-01 Jachym Cepicky 28 | PyWPS 3.1.0 29 | New stable release 30 | 31 | * Bugs: 32 | - Minor namespace fix 33 | 34 | 2009-05-19 Jachym Cepicky 35 | PyWPS 3.0.1rc4 36 | * Features: 37 | - new pythonish wrapper cgi script example added 38 | 39 | * Bugs: 40 | - Fixed bug on MS Windows: configuration files can be read now 41 | - Partly solved problem with os.fork() on MS Windows: PyWPS can NOT 42 | run in assynchronous mode on MS Windows (but it does not fail) 43 | - Fixed bug on Ubuntu 9.04 && Python 2.6 in the installing process 44 | 45 | 2009-03-15 Jachym Cepicky 46 | PyWPS 3.0.1rc3 47 | * Features: 48 | - Updated examples 49 | 50 | * Bugs: 51 | - small bugfixes 52 | 53 | 2009-03-11 Jachym Cepicky 54 | PyWPS 3.0.1rc2 55 | * Features: 56 | - Updated debian configuration files 57 | - New examples 58 | - Basic logfile enabled 59 | 60 | * Bugs: 61 | - few namespaces bugs 62 | - lineage works better now 63 | - setValue and getValue methods do accept file object as well, not only 64 | file names (string) 65 | - multiple bugs in status and store, process forking is back 66 | - bugfix for complex input data 67 | 68 | 2009-01-23 Jachym Cepicky 69 | PyWPS 3.0.1rc1 70 | * Features: 71 | - Updated debian configuration files 72 | 73 | * Bugs: 74 | - lineage and status attributes are parsed with namespaces 75 | - "http://" can be parsed as encoded string 76 | - bugfix in InAndOutputs.py: bad variable name 77 | - fixed missing default value parameter in describe process document 78 | - bugfix for complex input data 79 | 80 | 2008-09-16 Jachym Cepicky 81 | PyWPS 3.0.0 82 | 83 | * Support for OGC(R) WPS 1.0.0 84 | 85 | * New code strucuture: 86 | - completely rewritten source base 87 | - more object-orientation 88 | - simplification 89 | - python-htmltml templating system 90 | - support for internationalization 91 | 92 | * New configuration file /etc/pywps.cfg 93 | 94 | * New WPSProcess class with predefined methods for easier process 95 | coding: 96 | - addBBoxInput 97 | - addBBoxOutput 98 | - addComplexInput 99 | - addComplexOutput 100 | - addLiteralInput 101 | - addLiteralOutput 102 | - cmd 103 | - getInput 104 | - getInputValue 105 | - i18n 106 | - message 107 | - setOutputValue 108 | 109 | * New Status class with predefined methods: 110 | - set (msg='', percentDone=0) 111 | 112 | * New Input and Output classes: 113 | - setValue 114 | - getValue 115 | -------------------------------------------------------------------------------- /filters/PyWPS/INSTALL: -------------------------------------------------------------------------------- 1 | For installing PyWPS see 2 | 3 | http://pywps.wald.intevation.org/documentation/installation.html 4 | 5 | For Wiki see 6 | 7 | http://http://wiki.rsg.pml.ac.uk/pywps/Main_Page 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include setup.py 2 | include ChangeLog 3 | include LICENSE 4 | include AUTHORS 5 | include INSTALL 6 | include README 7 | include SUBMITTING 8 | 9 | graft pywps/Wps 10 | graft pywps/processes 11 | graft pywps/etc 12 | graft pywps/Parser 13 | graft pywps/Process 14 | graft pywps/Templates 15 | graft doc 16 | 17 | global-exclude *.pyc 18 | global-exclude *~ 19 | global-exclude *.swp 20 | global-exclude *.toc 21 | global-exclude *.bak 22 | global-exclude *.dvi 23 | global-exclude *.log 24 | global-exclude *.aux 25 | global-exclude *.tmplc 26 | 27 | exclude doc/*.out 28 | 29 | global-include *.cfg 30 | global-include README 31 | global-include AUTHORS 32 | global-include INSTALL 33 | -------------------------------------------------------------------------------- /filters/PyWPS/README: -------------------------------------------------------------------------------- 1 | PyWPS - Web Processing Service in Python 2 | 3 | This is an implementation of OGC's Web Processing Service. The main 4 | reason for this application is to bring at least part of GRASS GIS 5 | Functionality to World Wide Web. 6 | 7 | For installation and configuration read the INSTALL file. 8 | -------------------------------------------------------------------------------- /filters/PyWPS/RELEASE.howto: -------------------------------------------------------------------------------- 1 | SOURCE 2 | ====== 3 | 1 - Make new branch/tag 4 | 5 | git clone https://github.com/geopython/PyWPS.git 6 | git checkout $VERSION-branch 7 | git tag $VERSION 8 | git push 9 | 10 | Fix versions in the source 11 | ========================== 12 | edit setup.py <- fix version 13 | edit wps.py <- fix version 14 | 15 | svn ci -m"Releasing new version of PyWPS: X.Y.X" . 16 | 17 | Make the package 18 | ================ 19 | cd /tmp 20 | svn export svn copy svn+ssh://$DEVELOPER@svn.wald.intevation.org/pywps/branches/branch 21 | 22 | tar czf branch.tgz branch 23 | 24 | Upload file to file repository 25 | ============================== 26 | 27 | http://wald.intevation.org/frs/?group_id=22 28 | 29 | WEB PAGES 30 | ========= 31 | 1 - source/index.rst <- new version 32 | 2 - source/download/index.rst 33 | 34 | Maling List 35 | =========== 36 | 37 | PyWPS [VERSION] 38 | ############### 39 | 40 | PyWPS Development team announces new stable version of 41 | PyWPS[1] with number [VERSION] 42 | 43 | Features of this version: 44 | - [SHOULD COPY THIS FROM Changelog] 45 | 46 | For download this version, please follow the 47 | link below [2] or download PyWPS from subversion directly [3]. 48 | 49 | NOTE: [IF ANY] 50 | 51 | What is PyWPS: 52 | -------------- 53 | PyWPS (Python Web Processing Service) is implementation of Web 54 | Processing Service standard from Open Geospatial Consortium (OGC(R)). 55 | Processes can be written using GRASS GIS, but usage of other programs, like 56 | R package, GDAL or PROJ tools, is possible as well. 57 | 58 | Happy GISing! 59 | 60 | PyWPS Development team 61 | 62 | [1] http://pywps.wald.intevation.org 63 | [2] http://wald.intevation.org/frs/download.php/[FIX THE LINK] 64 | [3] svn checkout https://svn.wald.intevation.org/svn/pywps/tags/pywps-[FIX THE VERSION] 65 | -------------------------------------------------------------------------------- /filters/PyWPS/SUBMITTING: -------------------------------------------------------------------------------- 1 | Dear (new) PyWPS Developer, 2 | 3 | When submitting Python code to PyWPS SVN repository, please take 4 | care of following rules: 5 | 6 | 1. Look in the User documentation [http://wald.intevation.org/docman/view.php/22/71/install.pdf], so that you know, how PyWPS is working with custom processes. 7 | 8 | 2. Add a header section to each file you submit and make sure you include 9 | the copyright. The purpose section is meant to contain a general 10 | overview of the code in the file to assist other programmers that will 11 | need to make changes to your code. 12 | 13 | Example (ficticious header for a file called color.c) : 14 | 15 | # Author: Your Name 16 | # http://your.site 17 | # Lince: 18 | # 19 | # Your Process Description 20 | # Copyright (C) 2006 Your Name 21 | # 22 | # This program is free software; you can redistribute it and/or modify 23 | # it under the terms of the GNU General Public License as published by 24 | # the Free Software Foundation; either version 2 of the License, or 25 | # (at your option) any later version. 26 | # 27 | # This program is distributed in the hope that it will be useful, 28 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | # GNU General Public License for more details. 31 | # 32 | # You should have received a copy of the GNU General Public License 33 | # along with this program; if not, write to the Free Software 34 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 35 | 36 | The copyright protects your rights according to GNU General Public 37 | License (www.gnu.org). 38 | 39 | 3. If your process is using some GRASS location, please set the 40 | self.grassLocation to "/var/www/wps/spearfish60/" 41 | 42 | 4. Do not fear to use "if" condition for os.system calls, so you can 43 | check, if some external program failed or no: 44 | 45 | def execute(self): 46 | ... 47 | if os.system("g.copy rast1,rast2"): 48 | return "Failed to copy raster maps" 49 | 50 | 5. For lucidity purposes, you can use self.DataInputs['identifier'] and 51 | self.DataOutputs['identifier'] rather then self.Inputs[0]['value'] 52 | 53 | 6. In PyWPS SVN repository, only representation processes should be 54 | stored. All other processes should go to PyWPS Addons, which is located 55 | at PyWPS Wiki [http://pywps.ominiverdi.org/wiki] 56 | -------------------------------------------------------------------------------- /filters/PyWPS/TODO: -------------------------------------------------------------------------------- 1 | * the order of XML elements matters (dictionary -> array(?)) 2 | * contant info according to ISO 19115 3 | * list of allowed literal data inputs 4 | * many outputs array, also metadata about outputs (size, time) 5 | * for referenced outputs We need element instead of 6 | * add xsd link for execute response document 7 | * HTTP POST 8 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/changelog: -------------------------------------------------------------------------------- 1 | pywps (3.0.0-1) stable; urgency=low 2 | 3 | * New version 4 | * New code structure 5 | * New processes examples 6 | * New configuration file 7 | * See change log for more details 8 | 9 | -- Jachym Cepicky Thu, 16 Sep 2008 10:00:00 +0100 10 | pywps (2.0.0-1) stable; urgency=low 11 | 12 | * New version 13 | * New code structure 14 | * See change log for more details 15 | 16 | -- Jachym Cepicky Mon, 4 Jun 2007 15:38:00 +0200 17 | pywps (1.1.0-1) stable; urgency=low 18 | 19 | 1.1.0 devel 20 | Changes since 1.0.0: 21 | * ComplexValueReference input type definition is depredecated, 22 | use only ComplexValue - PyWPS will recognise the input type and handle 23 | it according to it. 24 | * GRASS location not created automaticly any more. 25 | * Rewritten exception handeling 26 | * Basic support for Range in LiteralValue definition 27 | 28 | -- Jachym Cepicky Fri, 2 Nov 2006 15:38:00 +0200 29 | pywps (1.0.0rc3-1) unstable; urgency=low 30 | 31 | pywps (1.0.0-1) stable; urgency=low 32 | 33 | 1.0.0 Stable 34 | Changes since RC3: 35 | * Fixed HTTP POST method 36 | * Added longer name for PyWPS PID file 37 | * Fixed small bug in BoundingBox 38 | 39 | -- Jachym Cepicky Fri, 2 Nov 2006 15:38:00 +0200 40 | pywps (1.0.0rc3-1) unstable; urgency=low 41 | 42 | * Release candidate 3 43 | 44 | -- Jachym Cepicky Fri, 2 Nov 2006 15:38:00 +0200 45 | 46 | pywps (1.0.0-1) unstable; urgency=low 47 | 48 | * Initial release 49 | 50 | -- Jachym Cepicky Fri, 20 Oct 2006 12:02:58 +0200 51 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/control: -------------------------------------------------------------------------------- 1 | Source: pywps 2 | Section: web 3 | Priority: optional 4 | Maintainer: Jachym Cepicky 5 | Build-Depends: debhelper (>= 4.0.0) 6 | Standards-Version: 3.6.2 7 | 8 | Package: pywps 9 | Architecture: all 10 | Depends: python, python-htmltmpl, python-xml 11 | Suggests: grass, apache2, apache 12 | Description: Implementation of OGC's Web Processing Service 13 | PyWPS is implementation of Web Processing Service from Open Geospatial Consortium Inc.(R) with help of Python Programming Language and GIS GRASS as working tool in background. 14 | Homepage of PyWPS can be found at http://pywps.wald.intevation.org 15 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Jachym Cepicky on 2 | Fri, 20 Oct 2006 12:02:58 +0200. 3 | 4 | It was downloaded from 5 | 6 | Copyright Holder: Jachym Cepicky 7 | 8 | License: GNU General Public Licence 9 | 10 | You are free to distribute this software under the terms of 11 | the GNU General Public License. 12 | On Debian systems, the complete text of the GNU General Public 13 | License can be found in the file `/usr/share/common-licenses/GPL'. 14 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/lib/cgi-bin 3 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/docs: -------------------------------------------------------------------------------- 1 | doc/pywps-howto.pdf 2 | doc/pywps-howto.txt 3 | doc/pywps-howto.html 4 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/files: -------------------------------------------------------------------------------- 1 | pywps_3.0.1-1_all.deb web optional 2 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.1: -------------------------------------------------------------------------------- 1 | .TH pywps 1 "" "PyWPS 1.0.0" "PyWPS" 2 | .SH NAME 3 | \fI\fBPyWPS\fR\fR - Implementation of OGC's Web Processing Service 4 | .br 5 | 6 | .SH DESCRIPTION 7 | .PP 8 | 9 | This program is to be used as CGI aplication. It is (not yet full) 10 | implementation of Open Geospatial Consorcium Web Processing Service (WPS) 11 | standard according to document OGC 05-007r4. As background tool GRASS GIS 12 | is used. 13 | .SH FEATURES 14 | .PP 15 | 16 | PyWPS Supports all three types of request: 17 | .br 18 | 19 | GetCapabilities 20 | .br 21 | 22 | DescribeProcess 23 | .br 24 | 25 | Execute 26 | .br 27 | 28 | Execute can be called assynchronously. 29 | .PP 30 | 31 | GRASS can work on temporary location in x/y coordinte system (default) or 32 | on existing location. Other popular tools (R, PROJ, GDAL/OGR) may be used 33 | too. 34 | .SH OPTIONS 35 | .PP 36 | 37 | This program should be run as web application 38 | Initial mapset directory which is a subdirectory of LOCATION_NAME 39 | .PP 40 | .SH BUGS AND CAVEAT 41 | .PP 42 | 43 | Not known so far 44 | 45 | .SH SEE ALSO 46 | OGC Web Processin Service standard 47 | .PP 48 | 49 | PyWPS Web site 50 | .SH AUTHORS (of this page) 51 | Jachym Cepicky 52 | .br 53 | 54 | .PP 55 | \fILast changed: $Date: 2006-10-23 $\fR 56 | .PP 57 | Help Index 58 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.doc-base: -------------------------------------------------------------------------------- 1 | Document: pywps 2 | Title: Install and Setup PyWPS 3 | Author: Jachym Cepicky 4 | Abstract: This manual describes what pywps is 5 | and how it can be installed, setuped and how to 6 | add your own processes to it. 7 | Section: web 8 | 9 | Format: PDF 10 | Files: /usr/share/doc/pywps/install.pdf 11 | 12 | Format: text 13 | Files: /usr/share/doc/pywps/intall.txt 14 | 15 | Format: HTML 16 | Index: /usr/share/doc/pywps/html/install.html 17 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ln -s /usr/bin/wps.py /usr/lib/cgi-bin/wps.py 4 | #chmod 777 /usr/lib/python2.5/site-packages/pywps/Templates/1_0_0 5 | #chmod 777 /usr/lib/python2.5/site-packages/pywps/Templates/1_0_0/inc 6 | 7 | /usr/bin/env python << EOF 8 | # compile templates 9 | # compiling before installing is necessary, because the apache 10 | # webserver has not the permission to create new files in the 11 | # python site-packages directory 12 | 13 | import os 14 | from htmltmpl import TemplateManager, TemplateProcessor 15 | from distutils import sysconfig 16 | 17 | baseDir = os.path.join(sysconfig.get_python_lib(), 18 | os.environ["DPKG_MAINTSCRIPT_PACKAGE"],'Templates') 19 | versionDirs = ['1_0_0'] 20 | 21 | template_files = ['GetCapabilities', 'DescribeProcess','Execute'] 22 | 23 | for version in versionDirs: 24 | for template_file in template_files: 25 | print 'Compiling template '+template_file 26 | template_file = os.path.join(baseDir,version, 27 | template_file + '.tmpl') 28 | template = TemplateManager().prepare(template_file) 29 | tproc = TemplateProcessor() 30 | compiled_document = tproc.process(template) 31 | EOF 32 | 33 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.postinst.debhelper: -------------------------------------------------------------------------------- 1 | # Automatically added by dh_installdocs 2 | if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then 3 | install-docs -i /usr/share/doc-base/pywps 4 | fi 5 | # End automatically added section 6 | # Automatically added by dh_python 7 | PYTHON=python2.5 8 | if which $PYTHON >/dev/null 2>&1 && [ -e /usr/lib/$PYTHON/compileall.py ]; then 9 | DIRLIST=" /usr/lib/python2.5/site-packages" 10 | for i in $DIRLIST ; do 11 | $PYTHON /usr/lib/$PYTHON/compileall.py -q $i 12 | done 13 | fi 14 | # End automatically added section 15 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | unlink /usr/lib/cgi-bin/wps.py 3 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.prerm.debhelper: -------------------------------------------------------------------------------- 1 | # Automatically added by dh_installdocs 2 | if [ "$1" = remove ] || [ "$1" = upgrade ] && \ 3 | which install-docs >/dev/null 2>&1; then 4 | install-docs -r pywps 5 | fi 6 | # End automatically added section 7 | # Automatically added by dh_python 8 | dpkg -L pywps | 9 | awk '$0~/\.py$/ {print $0"c\n" $0"o"}' | 10 | xargs rm -f >&2 11 | # End automatically added section 12 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/pywps.substvars: -------------------------------------------------------------------------------- 1 | python:Depends=python (>= 2.5), python (<< 2.6) 2 | -------------------------------------------------------------------------------- /filters/PyWPS/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Sample debian/rules that uses debhelper. 3 | # GNU copyright 1997 to 1999 by Joey Hess. 4 | 5 | # Uncomment this to turn on verbose mode. 6 | #export DH_VERBOSE=1 7 | 8 | # This is the debhelper compatibility version to use. 9 | export DH_COMPAT=4 10 | 11 | ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) 12 | CFLAGS += -g 13 | endif 14 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 15 | INSTALL_PROGRAM += -s 16 | endif 17 | 18 | build: build-stamp 19 | 20 | build-stamp: 21 | dh_testdir 22 | 23 | python setup.py build 24 | touch build-stamp 25 | 26 | clean:: 27 | dh_testdir 28 | dh_testroot 29 | python setup.py clean 30 | rm -f build-stamp 31 | rm -rf build 32 | 33 | dh_clean 34 | 35 | install: build 36 | dh_testdir 37 | dh_testroot 38 | dh_clean 39 | dh_installdirs 40 | 41 | python setup.py install --no-compile --root=`pwd`/debian/pywps 42 | 43 | # Build architecture-dependent files here. 44 | binary-arch: build install 45 | dh_testdir 46 | dh_testroot 47 | dh_installdocs 48 | dh_installexamples 49 | dh_installmenu 50 | dh_installmanpages 51 | dh_installchangelogs 52 | dh_link 53 | dh_strip 54 | dh_compress 55 | dh_fixperms 56 | dh_python 57 | dh_installdeb 58 | dh_shlibdeps 59 | dh_gencontrol 60 | dh_md5sums 61 | dh_builddeb 62 | 63 | binary: binary-arch 64 | .PHONY: build clean binary-arch binary install 65 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | export PYTHONPATH=../ 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 14 | 15 | .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest 16 | 17 | help: 18 | @echo "Please use \`make ' where is one of" 19 | @echo " html to make standalone HTML files" 20 | @echo " dirhtml to make HTML files named index.html in directories" 21 | @echo " pickle to make pickle files" 22 | @echo " json to make JSON files" 23 | @echo " htmlhelp to make HTML files and a HTML help project" 24 | @echo " qthelp to make HTML files and a qthelp project" 25 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 26 | @echo " changes to make an overview of all changed/added/deprecated items" 27 | @echo " linkcheck to check all external links for integrity" 28 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 29 | 30 | clean: 31 | -rm -rf build/* 32 | 33 | html: 34 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html 35 | @echo 36 | @echo "Build finished. The HTML pages are in build/html." 37 | 38 | dirhtml: 39 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) build/dirhtml 40 | @echo 41 | @echo "Build finished. The HTML pages are in build/dirhtml." 42 | 43 | pickle: 44 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle 45 | @echo 46 | @echo "Build finished; now you can process the pickle files." 47 | 48 | json: 49 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json 50 | @echo 51 | @echo "Build finished; now you can process the JSON files." 52 | 53 | htmlhelp: 54 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp 55 | @echo 56 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 57 | ".hhp project file in build/htmlhelp." 58 | 59 | qthelp: 60 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp 61 | @echo 62 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 63 | ".qhcp project file in build/qthelp, like this:" 64 | @echo "# qcollectiongenerator build/qthelp/PyWPS.qhcp" 65 | @echo "To view the help file:" 66 | @echo "# assistant -collectionFile build/qthelp/PyWPS.qhc" 67 | 68 | latex: 69 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex 70 | @echo 71 | @echo "Build finished; the LaTeX files are in build/latex." 72 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ 73 | "run these through (pdf)latex." 74 | 75 | changes: 76 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes 77 | @echo 78 | @echo "The overview file is in build/changes." 79 | 80 | linkcheck: 81 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck 82 | @echo 83 | @echo "Link check complete; look for any errors in the above output " \ 84 | "or in build/linkcheck/output.txt." 85 | 86 | doctest: 87 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) build/doctest 88 | @echo "Testing of doctests in the sources finished, look at the " \ 89 | "results in build/doctest/output.txt." 90 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/README: -------------------------------------------------------------------------------- 1 | HOWTO manage PyWPS Homepage 2 | =========================== 3 | 4 | step #1: edit source/* 5 | 6 | 7 | step #2: run 8 | 9 | make html 10 | 11 | 12 | step #3: rsync 13 | 14 | rsync --protocol 29 --delete-excluded --del -r build/html/ $DEVELOPER@wald.intevation.org:/pywps/htdocs/documentation/pywps-3.2/ 15 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | set SPHINXBUILD=sphinx-build 6 | set ALLSPHINXOPTS=-d build/doctrees %SPHINXOPTS% source 7 | if NOT "%PAPER%" == "" ( 8 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 9 | ) 10 | 11 | if "%1" == "" goto help 12 | 13 | if "%1" == "help" ( 14 | :help 15 | echo.Please use `make ^` where ^ is one of 16 | echo. html to make standalone HTML files 17 | echo. dirhtml to make HTML files named index.html in directories 18 | echo. pickle to make pickle files 19 | echo. json to make JSON files 20 | echo. htmlhelp to make HTML files and a HTML help project 21 | echo. qthelp to make HTML files and a qthelp project 22 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 23 | echo. changes to make an overview over all changed/added/deprecated items 24 | echo. linkcheck to check all external links for integrity 25 | echo. doctest to run all doctests embedded in the documentation if enabled 26 | goto end 27 | ) 28 | 29 | if "%1" == "clean" ( 30 | for /d %%i in (build\*) do rmdir /q /s %%i 31 | del /q /s build\* 32 | goto end 33 | ) 34 | 35 | if "%1" == "html" ( 36 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% build/html 37 | echo. 38 | echo.Build finished. The HTML pages are in build/html. 39 | goto end 40 | ) 41 | 42 | if "%1" == "dirhtml" ( 43 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% build/dirhtml 44 | echo. 45 | echo.Build finished. The HTML pages are in build/dirhtml. 46 | goto end 47 | ) 48 | 49 | if "%1" == "pickle" ( 50 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% build/pickle 51 | echo. 52 | echo.Build finished; now you can process the pickle files. 53 | goto end 54 | ) 55 | 56 | if "%1" == "json" ( 57 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% build/json 58 | echo. 59 | echo.Build finished; now you can process the JSON files. 60 | goto end 61 | ) 62 | 63 | if "%1" == "htmlhelp" ( 64 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% build/htmlhelp 65 | echo. 66 | echo.Build finished; now you can run HTML Help Workshop with the ^ 67 | .hhp project file in build/htmlhelp. 68 | goto end 69 | ) 70 | 71 | if "%1" == "qthelp" ( 72 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% build/qthelp 73 | echo. 74 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 75 | .qhcp project file in build/qthelp, like this: 76 | echo.^> qcollectiongenerator build\qthelp\PyWPS.qhcp 77 | echo.To view the help file: 78 | echo.^> assistant -collectionFile build\qthelp\PyWPS.ghc 79 | goto end 80 | ) 81 | 82 | if "%1" == "latex" ( 83 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% build/latex 84 | echo. 85 | echo.Build finished; the LaTeX files are in build/latex. 86 | goto end 87 | ) 88 | 89 | if "%1" == "changes" ( 90 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% build/changes 91 | echo. 92 | echo.The overview file is in build/changes. 93 | goto end 94 | ) 95 | 96 | if "%1" == "linkcheck" ( 97 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% build/linkcheck 98 | echo. 99 | echo.Link check complete; look for any errors in the above output ^ 100 | or in build/linkcheck/output.txt. 101 | goto end 102 | ) 103 | 104 | if "%1" == "doctest" ( 105 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% build/doctest 106 | echo. 107 | echo.Testing of doctests in the sources finished, look at the ^ 108 | results in build/doctest/output.txt. 109 | goto end 110 | ) 111 | 112 | :end 113 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/_static/pywps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/doc/source/_static/pywps.png -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Exceptions.rst: -------------------------------------------------------------------------------- 1 | Module Exceptions 2 | ================= 3 | .. automodule:: pywps.Exceptions 4 | :members: 5 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Grass.rst: -------------------------------------------------------------------------------- 1 | Module GRASS 2 | ============ 3 | .. automodule:: pywps.Grass 4 | :members: 5 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Parser/DescribeProcess.rst: -------------------------------------------------------------------------------- 1 | Module DescribeProcess 2 | ---------------------- 3 | .. automodule:: pywps.Parser.DescribeProcess 4 | 5 | Class Post 6 | .......... 7 | .. autoclass:: Post 8 | :members: 9 | 10 | Class Get 11 | ......... 12 | .. autoclass:: Get 13 | :members: 14 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Parser/Execute.rst: -------------------------------------------------------------------------------- 1 | Module Execute 2 | -------------- 3 | .. automodule:: pywps.Parser.Execute 4 | 5 | Class Post 6 | .......... 7 | .. autoclass:: Post 8 | :members: 9 | 10 | Class Get 11 | ......... 12 | .. autoclass:: Get 13 | :members: 14 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Parser/GetCapabilities.rst: -------------------------------------------------------------------------------- 1 | Module GetCapabilities 2 | ---------------------- 3 | .. automodule:: pywps.Parser.GetCapabilities 4 | 5 | Class Post 6 | .......... 7 | .. autoclass:: Post 8 | :members: 9 | 10 | Class Get 11 | ......... 12 | .. autoclass:: Get 13 | :members: 14 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Parser/index.rst: -------------------------------------------------------------------------------- 1 | Module Parser 2 | ============= 3 | Parser classes used by parsing of OGC WPS Requests 4 | 5 | Particular request packages: 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | 10 | GetCapabilities 11 | DescribeProcess 12 | Execute 13 | 14 | Module Parser 15 | ------------- 16 | .. automodule:: pywps.Parser 17 | .. autoclass:: Parser 18 | :members: 19 | 20 | Module Get 21 | ---------- 22 | .. automodule:: pywps.Parser.Get 23 | .. autoclass:: Get 24 | :members: 25 | 26 | Module Post 27 | ----------- 28 | .. automodule:: pywps.Parser.Post 29 | .. autoclass:: Post 30 | :members: 31 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Process/InAndOutputs.rst: -------------------------------------------------------------------------------- 1 | Module InAndOutputs 2 | ------------------- 3 | .. automodule:: pywps.Process.InAndOutputs 4 | 5 | Class Input 6 | ........... 7 | .. autoclass:: Input 8 | :members: 9 | 10 | Class LiteralInput 11 | .................. 12 | .. autoclass:: LiteralInput 13 | :members: 14 | 15 | Class ComplexInput 16 | .................. 17 | .. autoclass:: ComplexInput 18 | :members: 19 | 20 | Class BoundingBoxInput 21 | ...................... 22 | .. autoclass:: BoundingBoxInput 23 | :members: 24 | 25 | Class Output 26 | ............ 27 | .. autoclass:: Output 28 | :members: 29 | 30 | Class LiteralOutput 31 | ................... 32 | .. autoclass:: LiteralOutput 33 | :members: 34 | 35 | Class ComplexOutput 36 | ................... 37 | .. autoclass:: ComplexOutput 38 | :members: 39 | 40 | Class BoundingBoxOutput 41 | ....................... 42 | .. autoclass:: BoundingBoxOutput 43 | :members: 44 | 45 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Process/Lang.rst: -------------------------------------------------------------------------------- 1 | Module Lang 2 | ----------- 3 | 4 | .. automodule:: pywps.Process.Lang 5 | 6 | Class Lang 7 | .......... 8 | .. autoclass:: Lang 9 | :members: 10 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Process/index.rst: -------------------------------------------------------------------------------- 1 | Module Process 2 | ============== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | Lang 8 | InAndOutputs 9 | 10 | .. automodule:: pywps.Process 11 | 12 | Class Status 13 | ............. 14 | .. autoclass:: Status 15 | :members: 16 | 17 | Class WPSProcess 18 | ................ 19 | .. autoclass:: WPSProcess 20 | :members: 21 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Soap.rst: -------------------------------------------------------------------------------- 1 | Module Soap 2 | ----------- 3 | .. automodule:: pywps.Soap 4 | :members: 5 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Template.rst: -------------------------------------------------------------------------------- 1 | .. automodule:: pywps.Template 2 | :members: 3 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Wps/DescribeProcess.rst: -------------------------------------------------------------------------------- 1 | WPS DescribeProcess request handler 2 | ----------------------------------- 3 | .. automodule:: pywps.Wps.DescribeProcess 4 | 5 | Class DescribeProcess 6 | ..................... 7 | .. autoclass:: DescribeProcess 8 | :members: 9 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Wps/Execute.rst: -------------------------------------------------------------------------------- 1 | WPS Execute request handler 2 | --------------------------- 3 | .. automodule:: pywps.Wps.Execute 4 | 5 | Class Execute 6 | ............. 7 | .. autoclass:: Execute 8 | :members: 9 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Wps/GetCapabilities.rst: -------------------------------------------------------------------------------- 1 | WPS GetCapabilities request handler 2 | ----------------------------------- 3 | .. automodule:: pywps.Wps.GetCapabilities 4 | 5 | Class GetCapabilities 6 | ..................... 7 | .. autoclass:: GetCapabilities 8 | :members: 9 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/Wps/index.rst: -------------------------------------------------------------------------------- 1 | Module Wps 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | GetCapabilities 8 | DescribeProcess 9 | Execute 10 | 11 | .. automodule:: pywps.Wps 12 | 13 | Class Request 14 | ............. 15 | .. autoclass:: Request 16 | :members: 17 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/api/index.rst: -------------------------------------------------------------------------------- 1 | PyWPS API 2 | ********** 3 | The `pywps` package consists of several sub-packages and classes: 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | Exceptions 9 | Grass 10 | Parser/index 11 | Process/index 12 | Soap 13 | Template 14 | Wps/index 15 | 16 | Package pywps 17 | ============= 18 | .. automodule:: pywps 19 | 20 | .. autoclass:: Pywps 21 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/clients/index.rst: -------------------------------------------------------------------------------- 1 | .. _clients : 2 | 3 | WPS Clients 4 | *********** 5 | In this chapter, several (Py)WPS clients will be described. Some of them 6 | are part of the PyWPS distribution, others can be found on the Internet. 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | javascript 12 | qgis 13 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/index.rst: -------------------------------------------------------------------------------- 1 | PyWPS |version| Documentation 2 | ============================= 3 | Documentation for `PyWPS `_. PyWPS is 4 | implementation of `OGC Web Processing Service (WPS) `_, 5 | version 1.0.0. 6 | 7 | PyWPS is written in `Python `_. It 8 | is possible to run it as CGI, `Mod_python `_ environemnt, as well as Java 9 | servlet via `jython `_. 10 | 11 | PyWPS should be between server-side application and WPS clients. The 12 | application can be written with Python, Java or executabed from the command line. 13 | PyWPS was written with direct support for `GRASS GIS `_. 14 | 15 | Contents: 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | 20 | installation/index 21 | configuration/index 22 | testing/index 23 | process/index 24 | special/index 25 | clients/index 26 | api/index 27 | 28 | 29 | Indices and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/process/execute.rst: -------------------------------------------------------------------------------- 1 | Execution of the process 2 | ======================== 3 | Each process has to define a :meth:`pywps.Process.WPSProcess.execute` method, 4 | which makes the calculation and sets the output values. This method is 5 | called via a WPS Execute request. 6 | 7 | In principle, you can do what ever you need within this method. It is 8 | advised, to use python bindings to popular GIS packages, like `GRASS GIS 9 | `_, `GDAL/OGR `_, `PROJ4 10 | `_, or any other 11 | `Python-GIS package `_. 12 | 13 | In the :ref:`special` chapter, we give you a quick intro to some of 14 | these packages. Some examples are also distributed along with the PyWPS source. 15 | 16 | If you need to run some shell programs, you should use the 17 | :meth:`pywps.Process.WPSProcess.cmd` method. 18 | 19 | Below is an example of a simple execute method which transforms a raster file from 20 | one coordinate system to another, using Python bindings to GDAL.:: 21 | 22 | from osgeo import gdal 23 | from osgeo.gdalconst import * 24 | 25 | ... 26 | 27 | def execute(self): 28 | """Convert input raster file to PNG using GDAL""" 29 | 30 | # create gdal input dataset 31 | indataset = gdal.Open( self.inputRaster.getValue()) 32 | 33 | # get output driver for PNG format 34 | pngDriver = gdal.GetDriverByName("png") 35 | 36 | # define output gdal dataset 37 | outfile = "output.png" 38 | outdataset = pngDriver.CreateCopy(outfile, indataset) 39 | 40 | self.outputRaster.setValue(outfile) 41 | self.outputRaster.format = {'mimeType':"image/png"} 42 | 43 | return 44 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/process/index.rst: -------------------------------------------------------------------------------- 1 | .. _process: 2 | 3 | PyWPS Process 4 | ************* 5 | 6 | Processes directory 7 | =================== 8 | 9 | A PyWPS process can be thought of as a 10 | `Python module `_. All 11 | PyWPS processes are stored in one directory `Python Package `_. The :file:`__init__.py` file 12 | must contain the list of processes in `__all__` array. 13 | 14 | Default location for processes 15 | ------------------------------ 16 | The default location of PyWPS processes is located in the 17 | :file:`pywps/processes` directory, in the installation location of PyWPS. 18 | 19 | Configuration via :envvar:`PYWPS_PROCESSES` environment variable 20 | ---------------------------------------------------------------- 21 | Usually, you will overwrite this with the :envvar:`PYWPS_PROCESSES` environment 22 | variable in the :ref:`configuration`. 23 | 24 | Configuration via configuration file 25 | ------------------------------------ 26 | Alternatively you can set the `processesPath` variable in the configuration file. 27 | 28 | Logging 29 | ======= 30 | PyWPS uses Python module :mod:`logging` for logging purposes. If there is 31 | something you need to log (activity, variable content for debug or 32 | anything else), just import the module and use accordingly:: 33 | 34 | import logging 35 | ... 36 | 37 | logging.info("Just information message") 38 | logging.debug("Variable content: %s" % variable) 39 | logging.error("Error occured: %s" % e) 40 | 41 | The logs are printed to standard error, or to a file set in the configuration 42 | file :ref:`configuration`. Log level is set with `logLevel` option, also in 43 | the configuration file. 44 | 45 | .. toctree:: 46 | :maxdepth: 1 47 | 48 | structure 49 | puts 50 | execute 51 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/process/structure.rst: -------------------------------------------------------------------------------- 1 | Process structure 2 | ================= 3 | In the file containing the process, there must be one class with the name 4 | :class:`Process`, which is instance of :class:`pywps.Process.WPSProcess` class. 5 | Each process must contain at least two methods: 6 | :meth:`pywps.Process.WPSProcess.__init__` and :meth:`pywps.Process.WPSProcess.execute` . 7 | 8 | .. _process-initialization: 9 | Process initialization: __init__ method 10 | --------------------------------------- 11 | This method is the constructor for the actual process. It has to invoke the :meth:`pywps.Process.WPSProcess.__init__` method of the superior `WPSProcess` class with process configuration options, described in :class:`pywps.Process.WPSProcess` in more detail. 12 | 13 | 14 | The process can then define several 15 | :class:`pywps.Process.InAndOutputs.Input` and 16 | :class:`pywps.Process.InAndOutputs.Output` instances. Several methods can be used 17 | for this, namely :meth:`pywps.Process.WPSProcess.addLiteralInput`, :meth:`pywps.Process.WPSProcess.addComplexInput`, :meth:`pywps.Process.WPSProcess.addBBoxInput` for inputs and :meth:`pywps.Process.WPSProcess.addLiteralOutput`, :meth:`pywps.Process.WPSProcess.addComplexOutput`, :meth:`pywps.Process.WPSProcess.addBBoxOutput` for outputs. 18 | 19 | Process execution: execute method 20 | --------------------------------- 21 | The :meth:`pywps.Process.WPSProcess.execute` method, which is originally 22 | empty, is called by PyWPS for process execution. 23 | The actual calculation is to be done here. When the process 24 | returns any text, it is handled as an error message. When a process is successfully 25 | calculated, this method returns None. 26 | 27 | Example of PyWPS process 28 | ------------------------ 29 | 30 | .. literalinclude:: ../../../examples/returner.py 31 | :language: python 32 | 33 | After adding `"returner"` string to `__all__` array, in the 34 | :file:`__init__.py` file in the PyWPS Processes directory, we can try 35 | GetCapabilities, DescribeProcess and Execute requests. 36 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/special/grass.rst: -------------------------------------------------------------------------------- 1 | PyWPS and GRASS GIS 2 | ******************* 3 | PyWPS was originally written with support for `GRASS GIS 4 | `_. The processes can be executed within a temporary 5 | created GRASS Location or within an existing GRASS Location, within temporary 6 | created Mapset. If you are not familiar with this concepts, please review 7 | the GRASS documentation. 8 | 9 | Configuring PyWPS 10 | ================= 11 | First you have to configure PyWPS configuration file, as described in 12 | :ref:`configuration`. 13 | 14 | Allowing Process to be executed in the GRASS environment 15 | ======================================================== 16 | When you are initializing a new process (see :ref:`process-initialization`), 17 | you can add a :attr:`pywps.Process.WPSProcess.grassLocation` attribute to it. 18 | 19 | The attribute can have the following values: 20 | 21 | None 22 | GRASS Location is not created, GRASS environment is not started 23 | (default):: 24 | 25 | WPSProcess.__init__(self, identifier = "foo) 26 | 27 | True 28 | Temporary GRASS Location is created in XY coordinate system. 29 | .. note:: In the future, GRASS Location will probably have a 30 | coordinate system token from the input raster or vector file.:: 31 | 32 | WPSProcess.__init__(self, identifier = "foo", 33 | ..., 34 | grassLocation = True) 35 | String 36 | Name of the GRASS Location within the configured grassdbase. If the 37 | name starts with "/", the full path to the location is taken, without 38 | any other configuration.:: 39 | 40 | WPSProcess.__init__(self, identifier = "foo", 41 | ... 42 | grassLocation = "spearfish60") 43 | 44 | or:: 45 | 46 | WPSProcess.__init__(self, 47 | identifier = "foo", 48 | ... 49 | grassLocation = "/foo/bar/grassdata/spearfish60") 50 | 51 | Running GRASS modules from PyWPS 52 | ================================ 53 | 54 | You have two options: either run GRASS modules as you would do in 55 | shell script (running the modules directly) or access the GRASS-python 56 | interface. 57 | 58 | Running GRASS command line modules 59 | ---------------------------------- 60 | Once the :meth:`pywps.Process.WPSProcess.execute` method is executed, you 61 | can use the :meth:`pywps.Process.WPSProcess.cmd` method for calling GRASS 62 | modules. 63 | 64 | Using GRASS-Python interface 65 | ---------------------------- 66 | Since GRASS 6.4, Python bindings are supported. There are both a ctypes 67 | interface and GRASS Modules-Python interface. They are both described in 68 | the `GRASS Wiki `_ . There are 69 | :meth:`grass.run_command`, :meth:`grass.mapcalc` and other useful methods. 70 | 71 | GRASS-Python interface example 72 | .............................. 73 | :: 74 | 75 | from grass.script import core as grass 76 | from pywps.Process import WPSProcess 77 | 78 | process = WPSProcess(identifier="grassprocess", 79 | title="GRASS Process") 80 | 81 | def execute(): 82 | ret = grass.run_command("d.his", h_map = "drap_map", 83 | i_map = "relief_map", 84 | brighten = 0) 85 | return 86 | 87 | process.execute = execute 88 | 89 | 90 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/special/index.rst: -------------------------------------------------------------------------------- 1 | Special PyWPS Topics 2 | ==================== 3 | How to use PyWPS with other packages and projects 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | grass 9 | mapserver 10 | mod_python 11 | wsgi 12 | java 13 | gdal 14 | proj 15 | r 16 | 17 | 18 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/special/mapserver.rst: -------------------------------------------------------------------------------- 1 | PyWPS and UMN MapServer 2 | ----------------------- 3 | PyWPS can integrate `MapServer `_ to return results of ComplexData back 4 | to the client. 5 | 6 | The idea is as follows: if the client requires 7 | :class:`pywps.Process.InAndOutputs.ComplexOutput` to be returned, `as 8 | reference`, usually, a direct link to the produced file is returned. But with 9 | MapServer, a WFS, WMS or WCS URL could be returned. 10 | 11 | The client can later parse the URL of the resulting `ComplexValue` file and 12 | e.g. instead of having a GeoTIFF file (result of the calculation), obtained 13 | from the WCS, it can request a PNG file via WMS. 14 | 15 | Requirements 16 | ............ 17 | To support MapServer for ComplexOutputs in your PyWPS 18 | installation, the following packages have to be installed: 19 | 20 | * python-mapscript 21 | * python-gdal 22 | * python-pyproj 23 | 24 | Usage 25 | ..... 26 | When you are initializing a new process (see :ref:`process-initialization`), 27 | you can set the :attr:`pywps.Process.InAndOutputs.ComplexOutput.useMapscript` attribute to `True` to get it run. 28 | Have a look at the :class:`pywps.Process.InAndOutputs.ComplexOutput` 29 | documentation, also for other attributes, like projection or bbox (can be set 30 | automatically from georeferenced file). Required format 31 | (:attr:`pywps.Process.InAndOutputs.ComplexOutput.format` decides on the output 32 | service type (WCS for GeoTIFF and similar, WFS for xml or text, WMS for PNG, JPEG, GIF).:: 33 | 34 | 35 | self.outputMap = self.addComplexOutput(identifier = "map", 36 | title = "Resulting output map", 37 | formats = [ 38 | {"mimeType":"image/tiff"}, 39 | {"mimeType":"image/png"} 40 | ], 41 | useMapscript=True) 42 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/special/mod_python.rst: -------------------------------------------------------------------------------- 1 | PyWPS and Mod Python 2 | ******************** 3 | -------------------------------------------------------------------------------- /filters/PyWPS/doc/source/special/wsgi.rst: -------------------------------------------------------------------------------- 1 | PyWPS and WSGI 2 | ************** 3 | 4 | For more detailed information about WSGI, please visit their `website _`. 5 | In general WSGI is preferred over mod_python mode. 6 | 7 | * Install `mod_wsgi` for Apache server (if you are using it) 8 | * Locate `webservices/wsgi/wsgiwps.py` which provides the WSGI interface 9 | * Configure Apache server to something similar as:: 10 | 11 | SetEnv PYTHONPATH /usr/local/src/pywps/ # is not installed the 'clean' way 12 | SetEnv PYWPS_CFG /usr/local/src/pywpsworkdir/pywps.cfg 13 | SetEnv PYWPS_PROCESSES /usr/local/src/pywpsworkdir/processes 14 | 15 | Order allow,deny 16 | Allow from all 17 | 18 | WSGIScriptAlias /wps /usr/local/src/pywps/webservices/wsgi/wpswsgi.py 19 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Ftp.py: -------------------------------------------------------------------------------- 1 | """FTP helper class derived from ftplib.FTP to store login, password and fileName for remote response storage 2 | to enable relogin after connection closed without providing extra login information. For implementation details have 3 | a look at the ftplib.FTP documentation. 4 | """ 5 | # Author: Soeren Gebbert 6 | # soerengebbert@googlemail.com 7 | # Lince: 8 | # 9 | # Web Processing Service implementation 10 | # Copyright (C) 2006 Jachym Cepicky 11 | # 12 | # This program is free software; you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation; either version 2 of the License, or 15 | # (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | 27 | 28 | import ftplib 29 | import pywps 30 | 31 | 32 | class FTP(ftplib.FTP): 33 | 34 | def __init__(self, host='', port=21): 35 | """Store the user name, password and acct for futher uses and call the ftplib.FTP.__init__()""" 36 | ftplib.FTP.__init__(self) 37 | try: 38 | self.connect(host=host, port=port) 39 | except Exception, e: 40 | raise pywps.NoApplicableCode( 41 | e.__str__() + ": host=%s,port=%s" % (host, port)) 42 | #connect(host=host, port=6666) 43 | 44 | def login(self, user='', passwd='', acct=''): 45 | """Store the user name, password and acct for futher uses and call ftplib.FTP.login()""" 46 | ftplib.FTP.login(self, user, passwd, acct) 47 | 48 | def relogin(self): 49 | """"New method to allow the relogin without providing username and password""" 50 | self.login(self.user, self.passwd, self.acct) 51 | 52 | def setFileName(self, fileName): 53 | """"New method to set the filename which should be used on the ftp server""" 54 | self.fileName = fileName 55 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Parser/DescribeProcess.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module parses OGC Web Processing Service (WPS) DescribeProcess request. 3 | """ 4 | # Author: Jachym Cepicky 5 | # http://les-ejk.cz 6 | # jachym at les-ejk dot cz 7 | # Lince: 8 | # 9 | # Web Processing Service implementation 10 | # Copyright (C) 2006 Jachym Cepicky 11 | # 12 | # This program is free software; you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation; either version 2 of the License, or 15 | # (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | 27 | import xml.dom.minidom 28 | import pywps 29 | from pywps.Parser.Post import Post as PostParser 30 | from pywps.Parser.Get import Get as GetParser 31 | 32 | 33 | class Post(PostParser): 34 | """ 35 | Parses input request obtained via HTTP POST encoding - should be XML 36 | file. 37 | """ 38 | 39 | def __init__(self, wps): 40 | PostParser.__init__(self, wps) 41 | 42 | def parse(self, document, initInputs=None): 43 | 44 | if initInputs: 45 | self.inputs = initInputs 46 | 47 | self.document = document # input DOM 48 | 49 | firstChild = self.isSoapFirstChild(self.document) 50 | owsNameSpace = pywps.OWS_NAMESPACE 51 | identifiers = [] 52 | identifierNode = None 53 | 54 | # 55 | # Mandatory options 56 | 57 | # service & Request are already controlled 58 | 59 | # version 60 | self.checkVersion(firstChild) 61 | 62 | # identifiers 63 | for identifierNode in self.document.getElementsByTagNameNS( 64 | owsNameSpace, "Identifier"): 65 | identifiers.append(identifierNode.firstChild.nodeValue) 66 | if len(identifiers) == 0: 67 | raise pywps.MissingParameterValue("Identifier") 68 | self.inputs["identifier"] = identifiers 69 | 70 | # 71 | # Optional options 72 | 73 | # language 74 | self.checkLanguage(firstChild) 75 | 76 | return self.inputs 77 | 78 | 79 | class Get(GetParser): 80 | """ 81 | Parses input request obtained via HTTP GET encoding. 82 | """ 83 | 84 | def __init__(self, wps): 85 | GetParser.__init__(self, wps) 86 | 87 | def parse(self, unparsedInputs, initInputs=None): 88 | """ Parse given raw inputs""" 89 | 90 | if initInputs: 91 | self.inputs = initInputs 92 | 93 | self.unparsedInputs = unparsedInputs 94 | 95 | # 96 | # Mandatory options 97 | 98 | # service & Request are already controlled 99 | 100 | # version 101 | self.checkVersion() 102 | 103 | # identifier 104 | if "identifier" in self.unparsedInputs: 105 | self.inputs["identifier"] = self.unparsedInputs[ 106 | "identifier"].split(",") 107 | else: 108 | raise pywps.MissingParameterValue("identifier") 109 | 110 | # 111 | # Optional options 112 | 113 | # Language 114 | self.checkLanguage() 115 | 116 | return self.inputs 117 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Parser/__init__.py: -------------------------------------------------------------------------------- 1 | """Parser parses input parameters, send via HTTP Post or HTTP Get method. If 2 | send via HTTP Post, the input is usually XML file. 3 | 4 | Each class in the package is resposible for each type of the request. 5 | 6 | """ 7 | 8 | # Author: Jachym Cepicky 9 | # http://les-ejk.cz 10 | # Lince: 11 | # 12 | # Web Processing Service implementation 13 | # Copyright (C) 2006 Jachym Cepicky 14 | # 15 | # This program is free software; you can redistribute it and/or modify 16 | # it under the terms of the GNU General Public License as published by 17 | # the Free Software Foundation; either version 2 of the License. 18 | # 19 | # This program is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | # GNU General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU General Public License 25 | # along with this program; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | 29 | __all__ = [ 30 | "Get", 31 | "Post", 32 | "GetCapabilities", 33 | "DescribeProcess", 34 | "Execute" 35 | ] 36 | 37 | 38 | class Parser: 39 | """Parent class for all request parsers. 40 | 41 | .. attribute:: wps 42 | 43 | instace of :class:`pywps.Pywps` 44 | 45 | .. attribute:: isSoap 46 | 47 | indicates, whether the request is in Soap envelope or not 48 | 49 | .. attribute:: inputs 50 | 51 | object, where results of parsing is stored 52 | """ 53 | 54 | wps = None 55 | isSoap = False 56 | soapVersion = None 57 | isSoapExecute = None 58 | inputs = None 59 | 60 | def __init__(self, wps): 61 | self.wps = wps 62 | self.inputs = {} 63 | 64 | def _trueOrFalse(self, str): 65 | """Return True or False, if input is "true" or "false" 66 | :param str: String to be checks and returned 67 | :returns: bool or str 68 | """ 69 | if str.lower() == "false": 70 | return False 71 | elif str.lower() == "true": 72 | return True 73 | else: 74 | return str 75 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Process/Lang.py: -------------------------------------------------------------------------------- 1 | """ Set and get language codes, initialize translated messages, so that the 2 | user scan use them directly in processes. 3 | 4 | In the process: 5 | 6 | User has to define set of messages for all supported languages, like:: 7 | 8 | self.lang["eng"]["key1"] = "Hallo, world!" 9 | self.lang["eng"]["key2"] = "Foo" 10 | self.lang["eng"]["key3"] = "Bar" 11 | 12 | Than the user can use self.i18n(key) method, which returns the string 13 | in preset language (given by client request) 14 | 15 | """ 16 | # Author: Jachym Cepicky 17 | # http://les-ejk.cz 18 | # Lince: 19 | # 20 | # Web Processing Service implementation 21 | # Copyright (C) 2006 Jachym Cepicky 22 | # 23 | # This program is free software; you can redistribute it and/or modify 24 | # it under the terms of the GNU General Public License as published by 25 | # the Free Software Foundation; either version 2 of the License. 26 | # 27 | # This program is distributed in the hope that it will be useful, 28 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | # GNU General Public License for more details. 31 | # 32 | # You should have received a copy of the GNU General Public License 33 | # along with this program; if not, write to the Free Software 34 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 35 | # 02110-1301 USA 36 | 37 | import os 38 | 39 | 40 | class Lang: 41 | """Lang class""" 42 | 43 | # static list of language codes 44 | 45 | # taken from 46 | # http://www.loc.gov/standards/iso639-2/php/code_list.php 47 | 48 | # self.codes[0] = RFC 4646 49 | # self.codes[1] = ISO 639-1 50 | # self.codes[2] = English name 51 | 52 | # Good code list RFC 4646:http://sharpertutorials.com/list-of-culture-codes/ 53 | # Note: Previous versions supported # self.codes[0] = ISO 639-2 54 | 55 | codes = [ 56 | ["en-CA", "en", "english"], 57 | ["de-DE", "de", "german"], 58 | ["fr-FR", "fr", "french"], 59 | ["cz-CZ", "cz", "czech"], 60 | ["it-IT", "it", "italian"], 61 | ["gr-GR", "el", "greek"], 62 | ["ca-ES", "ca", "catalan"], 63 | ["es-ES", "es", "spanish"], 64 | ["fi-FI", "fi", "finnish"], 65 | ["sv-SE", "sv", "swedish"], 66 | ["pt-PT", "pt", "portuguese"], 67 | # to be continued ... 68 | ] 69 | defaultCode = "en-CA" 70 | 71 | # static method 72 | def getCode(langString): 73 | 74 | for lang in Lang.codes: 75 | if langString.lower() in [code.lower() for code in lang]: 76 | return lang[0] 77 | # return None if nothing found 78 | return None 79 | 80 | getCode = staticmethod(getCode) 81 | 82 | def __init__(self): 83 | 84 | # default 85 | self.code = self.defaultCode 86 | self.strings = {} 87 | self.initStrings() 88 | 89 | def setCode(self, code): 90 | """ Set chosen language code """ 91 | 92 | self.code = Lang.getCode(code) 93 | if not self.code: 94 | self.code = self.defaultCode 95 | return 96 | 97 | def initStrings(self): 98 | """ Initialize self.strings object according to known codes from 99 | Lang.py 100 | 101 | It can be used later like:: 102 | 103 | self.strings["eng"]["foo"] = "bar" 104 | 105 | """ 106 | 107 | for lang in self.codes: 108 | self.strings[lang[0]] = {} 109 | return 110 | 111 | def get(self, key): 112 | """ Will return desired string in selected language """ 113 | 114 | if self.strings[self.code].has_key(key): 115 | return self.strings[self.code][key] 116 | 117 | return key 118 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Process/Process.py: -------------------------------------------------------------------------------- 1 | from pywps.Process import WPSProcess 2 | import sys 3 | print >>sys.stderr, """PyWPS Warning: Usage of""" 4 | print >>sys.stderr, """PyWPS Warning: from pywps.Process.Process import WPSProcess""" 5 | print >>sys.stderr, """PyWPS Warning: is deprecated. Use """ 6 | print >>sys.stderr, """PyWPS Warning: from pywps.Process import WPSProcess""" 7 | print >>sys.stderr, """PyWPS Warning: instead!""" 8 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/DescribeProcess.tmpl: -------------------------------------------------------------------------------- 1 | "?> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/DescribeProcess.tmplc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/Templates/1_0_0/DescribeProcess.tmplc -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/Execute.tmplc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/Templates/1_0_0/Execute.tmplc -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/GetCapabilities.tmplc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/Templates/1_0_0/GetCapabilities.tmplc -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/Templates/1_0_0/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/inc/DescribeProcess_BoundingBoxValue.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/inc/DescribeProcess_ComplexValue.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/inc/DescribeProcess_LiteralValue.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/inc/Execute_Data_Inputs.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | mimeType="" schema="" encoding=""> 4 | 5 | 6 | 7 | 8 | dataType="" uom=""> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/inc/Execute_Data_Outputs.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | mimeType="" schema="" encoding=""> 4 | 5 | ]]> 6 | 7 | 8 | 9 | 10 | dataType="" uom=""> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/1_0_0/inc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/Templates/1_0_0/inc/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/pywps/Templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/Templates/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/pywps/XSLT/WPS2SOAP.xsl: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 8 | 9 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/XSLT/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/pywps/XSLT/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/pywps/buffer.cfg: -------------------------------------------------------------------------------- 1 | [wps] 2 | encoding=utf-8 3 | title=WPS for QGIS Server 4 | version=1.0.0 5 | abstract=Web Processing Capabilities for QGIS Server based on PyWPS. See http://pywps.wald.intevation.org and http://www.opengeospatial.org/standards/wps 6 | fees=None 7 | constraints=none 8 | serveraddress=http://localhost/cgi-bin/wps 9 | keywords=QGIS,Processing,WPS 10 | lang=en-US 11 | 12 | [provider] 13 | providerName=Your Company Name 14 | individualName=Your Name 15 | positionName=Your Position 16 | role=Your role 17 | deliveryPoint=Street 18 | city=City 19 | postalCode=000 00 20 | country=eu 21 | electronicMailAddress=login@server.org 22 | providerSite=http://foo.bar 23 | phoneVoice=False 24 | phoneFacsimile=False 25 | administrativeArea=False 26 | hoursofservice=0:00-24:00 27 | contactinstructions=none 28 | 29 | [server] 30 | maxoperations=30 31 | maxinputparamlength=1024 32 | maxfilesize=3mb 33 | tempPath=/tmp 34 | processesPath= 35 | outputUrl=http://localhost/wps/wpsoutputs 36 | #outputPath=/var/www/wps/wpsoutputs 37 | outputPath=/tmp/wpsoutputs 38 | debug=true # deprecated since 3.2, use logLevel instead 39 | logFile=/tmp/pywps.log 40 | logLevel=INFO 41 | 42 | [qgis] 43 | providers=qgis 44 | algs_filter=buffer 45 | algs= 46 | processing_folder=/var/processes/processing 47 | qgisserveraddress=http://localhost/cgi-bin/qgis_mapserv.fcgi 48 | input_bbox_crss=EPSG:4326,EPSG:3857 49 | output_ows_crss=EPSG:4326,EPSG:3857 50 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/default.cfg: -------------------------------------------------------------------------------- 1 | [wps] 2 | encoding=utf-8 3 | title=WPS for QGIS Server 4 | version=1.0.0 5 | abstract=Web Processing Capabilities for QGIS Server based on PyWPS. See http://pywps.wald.intevation.org and http://www.opengeospatial.org/standards/wps 6 | fees=None 7 | constraints=none 8 | serveraddress= 9 | keywords=QGIS,Processing,WPS 10 | lang=en-US 11 | 12 | [provider] 13 | providerName=Your Company Name 14 | individualName=Your Name 15 | positionName=Your Position 16 | role=Your role 17 | deliveryPoint=Street 18 | city=City 19 | postalCode=000 00 20 | country=eu 21 | electronicMailAddress=login@server.org 22 | providerSite=http://foo.bar 23 | phoneVoice=False 24 | phoneFacsimile=False 25 | administrativeArea=False 26 | hoursofservice=0:00-24:00 27 | contactinstructions=none 28 | 29 | [server] 30 | maxoperations=30 31 | maxinputparamlength=1024 32 | maxfilesize=3mb 33 | tempPath=/tmp 34 | processesPath= 35 | outputUrl=http://localhost/wps/wpsoutputs 36 | #outputPath=/var/www/wps/wpsoutputs 37 | outputPath=/tmp/wpsoutputs 38 | debug=true # deprecated since 3.2, use logLevel instead 39 | logFile=/tmp/pywps.log 40 | logLevel=INFO 41 | 42 | [qgis] 43 | qgisserveraddress=http://localhost/cgi-bin/qgis_mapserv.fcgi 44 | #processing_folder=/path/to/processes/processing that contains models, scripts and rscripts directory 45 | processing_folder=../../../../../../processing 46 | #providers= providers list separated by comma 47 | providers= 48 | #algs_filter= algorithms filter 49 | algs_filter= 50 | #algs= algorithms list separated by comma 51 | algs= 52 | # define supported CRSs 53 | input_bbox_crss=EPSG:4326,EPSG:3857 54 | output_ows_crss=EPSG:4326,EPSG:3857 55 | # default mime type value for all WPS output 56 | outputs_minetypes_vector=application/x-ogc-wms,application/gml+xml 57 | outputs_minetypes_raster=application/x-ogc-wms,image/tiff 58 | 59 | [qgis_processing] 60 | ACTIVATE_QGIS=True 61 | ACTIVATE_GDALOGR=True 62 | ACTIVATE_SCRIPT=True 63 | ACTIVATE_MODEL=True 64 | ACTIVATE_R=True 65 | ACTIVATE_GRASS=False 66 | ACTIVATE_GRASS70=False 67 | ACTIVATE_SAGA=True 68 | #MODELS_FOLDER=/path/to/processes/processing/models 69 | #SCRIPTS_FOLDER=/path/to/processes/processing/scripts 70 | #R_SCRIPTS_FOLDER=/home/path/to/processes/processing/rscripts 71 | SAGA_208=False 72 | SAGA_IMPORT_EXPORT_OPTIMIZATION=False 73 | SAGA_AUTO_RESAMPLING=True 74 | SAGA_RESAMPLING_REGION_CELLSIZE=1 75 | SAGA_RESAMPLING_REGION_XMIN=0 76 | SAGA_RESAMPLING_REGION_YMIN=0 77 | SAGA_RESAMPLING_REGION_XMAX=1000 78 | SAGA_RESAMPLING_REGION_YMAX=1000 79 | SAGA_LOG_CONSOLE=True 80 | SAGA_LOG_COMMANDS=True 81 | 82 | [grass] 83 | path=/usr/lib/grass/bin/:/usr/lib/grass/scripts/ 84 | addonPath= 85 | version=6.2.1 86 | gui=text 87 | gisbase=/usr/lib/grass/ 88 | ldLibraryPath=/usr/lib/grass/lib 89 | gisdbase=grassdata/ 90 | 91 | [mapserver] 92 | mapserveraddress=http://localhost/cgi-bin/mapserv 93 | projdatapath=/usr/lib/proj/ 94 | projs=epsg:4326,epsg:102067,epsg:3059,epsg:900913 95 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/etc/pywps.cfg-template: -------------------------------------------------------------------------------- 1 | [wps] 2 | encoding=utf-8 3 | title=PyWPS Development Server 4 | version=1.0.0 5 | abstract=Development version of PyWPS. See http://pywps.wald.intevation.org 6 | fees=None 7 | constraints=none 8 | serveraddress=http://localhost/cgi-bin/wps 9 | keywords=GRASS,GIS,WPS 10 | lang=eng,ger 11 | 12 | [provider] 13 | providerName=Your Company Name 14 | individualName=Your Name 15 | positionName=Your Position 16 | role=Your role 17 | deliveryPoint=Street 18 | city=City 19 | postalCode=000 00 20 | country=eu 21 | electronicMailAddress=login@server.org 22 | providerSite=http://foo.bar 23 | phoneVoice=False 24 | phoneFacsimile=False 25 | administrativeArea=False 26 | 27 | [server] 28 | maxoperations=3 29 | maxinputparamlength=1024 30 | maxfilesize=3mb 31 | tempPath=/tmp 32 | processesPath= 33 | outputUrl=http://localhost/wps/wpsoutputs 34 | outputPath=/var/www/wps/wpsoutputs 35 | debug=true 36 | 37 | [grass] 38 | path=/usr/lib/grass/bin/:/usr/lib/grass/scripts/ 39 | addonPath= 40 | version=6.2.1 41 | gui=text 42 | gisbase=/usr/lib/grass/ 43 | ldLibraryPath=/usr/lib/grass/lib 44 | gisdbase=/home/user/grassdata 45 | #home=/var/www/ 46 | 47 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/processes/README: -------------------------------------------------------------------------------- 1 | This folder contains processes, which can be offerd by the server to be 2 | executed from the client. 3 | 4 | The processes folder needs to contain one __init__.py with __all__ list of 5 | available processes, e.g. 6 | 7 | __all__ = ["foo","bar"] 8 | 9 | will make processes in files "foo.py" and "bar.py" available (suppose, they 10 | exist in this folder). 11 | 12 | Several examples, as well as example of __init__.py file are already in 13 | this folder, named with "-dist" extension. To make everything work, just 14 | run 15 | 16 | for f in *-dist; do out="`echo $f|sed -e 's/-dist//'`"; mv $f $out; done 17 | 18 | This folder does not have to be, where you found it, it can be stored 19 | anywhere in your system (e.g. /usr/local/pywps/myprocesses). Than you have 20 | to setup 'processesPath' variable in [server] section of the configuration 21 | file (pywps.cfg). 22 | 23 | You can also have multiple WPS servers with only one PyWPS installation, by 24 | creating multiple process directories (e.g. /usr/local/pywps/myprocesses, 25 | /usr/local/pywps/customprocesses, /foo/bar/prc, ...) and exporting 26 | PYWPS_PROCESES environment variable. 27 | 28 | For example, suppose, you want to have multiple urls, with differet set of 29 | WPS processes. For each WPS server (set of processes) create separate file 30 | in /usr/lib/cgi-bin/ with following content (e.g.): 31 | 32 | #!/bin/sh 33 | export PYWPS_PROCESES=/usr/local/myprocesses 34 | /usr/bin/wps.py 35 | # end of file 36 | 37 | you can call the file e.g. (/usr/lib/cgi-bin/mywps 38 | 39 | another file (/usr/lib/cgi-bin/foowps) should look like this 40 | 41 | #!/bin/sh 42 | export PYWPS_PROCESES=/foo/bar/prc/ 43 | /usr/bin/wps.py 44 | # end of file 45 | 46 | and so on 47 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/processes/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["returner", "dummyprocess", "ultimatequestionprocess", "moreInOne", 2 | "moreInstancesInOne", "tests", "GMLBuffer", "reducer", "histogramprocess"] 3 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/processes/dummyprocess.py: -------------------------------------------------------------------------------- 1 | """ 2 | DummyProcess to check the WPS structure 3 | 4 | Author: Jorge de Jesus (jorge.jesus@gmail.com) as suggested by Kor de Jong 5 | """ 6 | from pywps.Process import WPSProcess 7 | import types 8 | 9 | 10 | class Process(WPSProcess): 11 | 12 | def __init__(self): 13 | # init process 14 | WPSProcess.__init__(self, 15 | identifier="dummyprocess", # must be same, as filename 16 | title="Dummy Process", 17 | version="0.1", 18 | storeSupported="true", 19 | statusSupported="true", 20 | abstract="The Dummy process is used for testing the WPS structure. The process will accept 2 input numbers and will return the XML result with an add one and subtract one operation", 21 | grassLocation=False) 22 | 23 | self.Input1 = self.addLiteralInput(identifier="input1", 24 | title="Input1 number", 25 | type=types.IntType, 26 | default="100") 27 | self.Input2 = self.addLiteralInput(identifier="input2", 28 | title="Input2 number", 29 | type=types.IntType, 30 | default="200") 31 | self.Output1 = self.addLiteralOutput(identifier="output1", 32 | title="Output1 add 1 result") 33 | self.Output2 = self.addLiteralOutput( 34 | identifier="output2", title="Output2 subtract 1 result") 35 | 36 | def execute(self): 37 | 38 | self.Output1.setValue(int(self.Input1.getValue()) + 1) 39 | self.Output2.setValue(int(self.Input1.getValue()) - 1) 40 | return 41 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/processes/moreInOne.py: -------------------------------------------------------------------------------- 1 | from pywps.Process import WPSProcess 2 | 3 | 4 | class FirstProcess(WPSProcess): 5 | 6 | def __init__(self): 7 | WPSProcess.__init__(self, identifier="complexVector", 8 | title="First Process", 9 | abstract="Get vector imput and return it to output", 10 | statusSupported=True, 11 | storeSupported=True) 12 | 13 | self.indata = self.addComplexInput( 14 | identifier="indata", title="Complex in") 15 | self.outdata = self.addComplexOutput( 16 | identifier="outdata", title="Compex out") 17 | self.outdata2 = self.addComplexOutput( 18 | identifier="outdata2", title="Compex out") 19 | 20 | def execute(self): 21 | self.outdata.setValue(self.indata.getValue()) 22 | self.outdata2.setValue(self.indata.getValue()) 23 | 24 | 25 | class SecondProcess(WPSProcess): 26 | 27 | def __init__(self): 28 | WPSProcess.__init__(self, identifier="complexRaster", 29 | version="2.0", 30 | title="Second Process") 31 | 32 | self.indata = self.addComplexInput(identifier="indata", title="Complex in", 33 | formats=[{"mimeType": "image/tiff"}]) 34 | self.outdata = self.addComplexOutput(identifier="outdata", 35 | title="Compex out", 36 | formats=[{"mimeType": "image/tiff"}]) 37 | 38 | def execute(self): 39 | self.outdata.setValue(self.indata.getValue()) 40 | 41 | 42 | class ThridProcess(WPSProcess): 43 | 44 | def __init__(self): 45 | WPSProcess.__init__(self, identifier="noOutput", 46 | title="No output given") 47 | 48 | def execute(self): 49 | pass 50 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/processes/moreInstancesInOne.py: -------------------------------------------------------------------------------- 1 | from pywps.Process import WPSProcess 2 | 3 | myFirstProcess = WPSProcess(identifier="firstInstance", 4 | title="First instance process") 5 | 6 | mySecondProcess = WPSProcess(identifier="secondInstance", 7 | title="Second instance process") 8 | 9 | #WPSProcess(identifier="firstInstance", title="First instance process") 10 | -------------------------------------------------------------------------------- /filters/PyWPS/pywps/processes/ultimatequestionprocess.py: -------------------------------------------------------------------------------- 1 | """ 2 | The ultimate process to test the status and update capabilities of the server 3 | The processes shoul be requested as follows: 4 | ../wps.py?request=execute 5 | &service=wps 6 | &version=1.0.0 7 | &identifier=ultimatequestionprocess 8 | &status=true 9 | &storeExecuteResponse=true 10 | 11 | Done by Jorge de Jesus (jorge.mendesdejesus@wur.nl) as suggested by Kor de Jong 12 | 13 | """ 14 | 15 | from pywps.Process.Process import WPSProcess 16 | 17 | 18 | class Process(WPSProcess): 19 | 20 | def __init__(self): 21 | # init process 22 | WPSProcess.__init__(self, 23 | identifier="ultimatequestionprocess", # the same as the file name 24 | version="2.0", 25 | title="Answer to Life, the Universe and Everything", 26 | storeSupported="false", 27 | statusSupported="false", 28 | abstract="Numerical solution that is the answer to Life, Universe and Everything. The process is an improvement to Deep Tought computer (therefore version 2.0) since it no longer takes 7.5 milion years, but only a few seconds to give a response, with an update of status every 10 seconds.", 29 | grassLocation=False) 30 | # No need for inputs since Execute will start the process 31 | self.Answer = self.addLiteralOutput(identifier="answer", 32 | title="The numerical answer to Life, Universe and Everything") 33 | 34 | def execute(self): 35 | import time 36 | 37 | self.status.set("Preparing....", 0) 38 | for i in xrange(1, 11): 39 | time.sleep(5) 40 | self.status.set("Thinking.....", float(i * 10)) 41 | # The final answer 42 | self.Answer.setValue("42") 43 | -------------------------------------------------------------------------------- /filters/PyWPS/rpm/pywps.changes: -------------------------------------------------------------------------------- 1 | Wed Apr 18 00:27:31 UTC 2012 - tzotsos@opensuse.org 2 | 3 | - Updated to 3.2.1 4 | 5 | ---------------------------------------------------- 6 | Tue Apr 5 00:00:00 CST 2011 - tzotsos@opensuse.org 7 | 8 | - initial OBS Build 9 | 10 | -------------------------------------------------------------------------------- /filters/PyWPS/rpm/pywps.spec: -------------------------------------------------------------------------------- 1 | # 2 | # spec file for package pywps (3.2.1) 3 | # 4 | # Copyright (c) 2012 Angelos Tzotsos 5 | # 6 | # This file and all modifications and additions to the pristine 7 | # package are under the same license as the package itself. 8 | 9 | # Please submit bugfixes or comments via http://bugs.opensuse.org/ 10 | # 11 | 12 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} 13 | %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} 14 | 15 | %define pyname pywps 16 | 17 | Name: python-%{pyname} 18 | Version: 3.2.1 19 | Release: 1 20 | License: GPL 21 | Summary: OGC Web Processing Servisce in Python 22 | Url: http://pywps.wald.intevation.org/index.html 23 | Group: Productivity/Scientific/Other 24 | Source0: %{pyname}-%{version}.tar.gz 25 | BuildRequires: fdupes 26 | BuildRequires: python-devel python-xml python-htmltmpl python-setuptools 27 | Requires: python python-xml python-htmltmpl 28 | 29 | BuildRoot: %{_tmppath}/%{name}-%{version}-build 30 | 31 | %{py_requires} 32 | 33 | %description 34 | Python Web Processing Service is an implementation of the Web processing Service standard from Open Geospatial Consortium. 35 | 36 | %prep 37 | %setup -q -n %{pyname}-%{version} 38 | 39 | %build 40 | 41 | %install 42 | %__python setup.py install --prefix=%{_prefix} --root=%{buildroot} --record-rpm=INSTALLED_FILES 43 | %fdupes -s %{buildroot} 44 | 45 | %clean 46 | %__rm -rf %{buildroot} 47 | 48 | %files -f INSTALLED_FILES 49 | %defattr(-,root,root) 50 | %dir %{python_sitelib}/pywps 51 | %{python_sitelib}/pywps/ 52 | 53 | %changelog 54 | -------------------------------------------------------------------------------- /filters/PyWPS/setup.py: -------------------------------------------------------------------------------- 1 | """PyWPS: Implementation of OGC's Web Processing Service in Python 2 | 3 | PyWPS is simple cgi set of scripts, which (nearly) fills standard of OGC 4 | (http://opengis.org) Web Processing Service. This standard describes the 5 | way how geoinformation operations should be served via networks. 6 | 7 | PyWPS provides environment for writing own scripts with help of GIS GRASS 8 | modules (http://grass.osgeo.it). User of PyWPS can easily focuse on writing 9 | own GRASS-scripts, without taking care on how the data will be imported and 10 | served back to the client. Providing GRASS funktionality on the Internet 11 | should be as easy as possible. 12 | """ 13 | 14 | import sys 15 | import os 16 | import pywps 17 | from pywps.Template import TemplateProcessor 18 | 19 | 20 | def get_current_path(): 21 | return os.path.abspath(os.path.dirname(__file__)) 22 | 23 | 24 | def get_templates_path(base): 25 | return os.path.join(base, 'pywps', 'Templates') 26 | 27 | 28 | def compile_templates(base): 29 | versionDirs = ['1_0_0'] 30 | 31 | template_files = ['GetCapabilities', 'DescribeProcess', 'Execute'] 32 | 33 | for version in versionDirs: 34 | for template_file in template_files: 35 | print "Compiling template " + template_file + " in " + base 36 | template_file = os.path.join( 37 | base, version, template_file + '.tmpl') 38 | template = TemplateProcessor(fileName=template_file, compile=True) 39 | 40 | # First compile templates 41 | PYWPS_PATH = get_current_path() 42 | TEMPLATES_PATH = get_templates_path(PYWPS_PATH) 43 | compile_templates(TEMPLATES_PATH) 44 | 45 | 46 | name = 'pywps' 47 | 48 | classifiers = [ 49 | 'Development Status :: 5 - Production/Stable', 50 | 'Environment :: Web Environment', 51 | 'Intended Audience :: Developers', 52 | 'License :: OSI Approved :: GNU General Public License (GPL)', 53 | 'Operating System :: MacOS :: MacOS X', 54 | 'Operating System :: Microsoft :: Windows', 55 | 'Operating System :: POSIX', 56 | 'Programming Language :: Python', 57 | 'Topic :: Communications :: Email', 58 | 'Topic :: Office/Business', 59 | 'Topic :: Software Development :: Bug Tracking', 60 | ] 61 | 62 | 63 | #from distutils.core import setup 64 | from setuptools import setup 65 | import sys 66 | import os 67 | import traceback 68 | 69 | doclines = __doc__.split("\n") 70 | 71 | 72 | dist = setup( 73 | name=name, 74 | version='3.2.2', 75 | maintainer="Jachym Cepicky", 76 | maintainer_email='jachym.cepicky@gmail.com', 77 | author='Jachym Cepicky', 78 | author_email='jachym.cepicky@gmail.com', 79 | url='http://pywps.wald.intevation.org', 80 | license="http://www.gnu.org/licenses/gpl.html", 81 | download_url="http://pywps.wald.intevation.org", 82 | description=doclines[0], 83 | zip_safe=False, 84 | platforms=["any"], 85 | classifiers=classifiers, 86 | long_description="\n".join(doclines[1:]), 87 | 88 | packages=[ 89 | 'pywps', 90 | 'pywps.Wps', 91 | 'pywps.Wps.Execute', 92 | 'pywps.XSLT', 93 | 'pywps.Parser', 94 | 'pywps.Process', 95 | 'pywps.processes', 96 | 'pywps.Templates', 97 | 'pywps.Templates.1_0_0', 98 | ], 99 | package_dir={ 100 | 'pywps': "pywps", 101 | 'pywps.Wps': 'pywps/Wps', 102 | 'pywps.Wps.Execute': 'pywps/Wps/Execute', 103 | 'pywps.XSLT': 'pywps/XSLT', 104 | 'pywps.Parser': 'pywps/Parser', 105 | 'pywps.Process': 'pywps/Process', 106 | 'pywps.Templates': 'pywps/Templates', 107 | 'pywps.Templates.1_0_0': 'pywps/Templates/1_0_0', 108 | 'pywps.Templates.1_0_0.inc': 'pywps/Templates/1_0_0/inc', 109 | }, 110 | package_data={ 111 | 'pywps': 112 | ['Templates/1_0_0/*.tmplc', 113 | 'XSLT/*.xsl', 114 | 'processes/*.py-dist', 'processes/README', 115 | 'default.cfg'] 116 | }, 117 | scripts=['wps.py'] 118 | ) 119 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/DescribeProcess.tmpl: -------------------------------------------------------------------------------- 1 | "?> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/tests/Templates/1_0_0/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/inc/DescribeProcess_BoundingBoxValue.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/inc/DescribeProcess_ComplexValue.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/inc/DescribeProcess_LiteralValue.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/inc/Execute_Data_Inputs.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | mimeType="" schema="" encoding=""> 4 | 5 | 6 | 7 | 8 | dataType="" uom=""> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/inc/Execute_Data_Outputs.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | mimeType="" schema="" encoding=""> 4 | 5 | ]]> 6 | 7 | 8 | 9 | 10 | dataType="" uom=""> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/1_0_0/inc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/tests/Templates/1_0_0/inc/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/tests/Templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/tests/Templates/__init__.py -------------------------------------------------------------------------------- /filters/PyWPS/tests/datainputs/dem.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/filters/PyWPS/tests/datainputs/dem.tiff -------------------------------------------------------------------------------- /filters/PyWPS/tests/datainputs/lakes.gfs: -------------------------------------------------------------------------------- 1 | 2 | 3 | lakes 4 | lakes 5 | 6 | 15 7 | -1829520.49845 8 | 967395.73710 9 | 2714990.22347 10 | 7566011.26771 11 | 12 | 13 | cat 14 | cat 15 | Integer 16 | 17 | 18 | NAMES 19 | NAMES 20 | String 21 | 18 22 | 23 | 24 | AREA_MI 25 | AREA_MI 26 | Real 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/envvars_tests.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | pywpsPath = os.path.abspath(os.path.join( 5 | os.path.split(os.path.abspath(__file__))[0], "..")) 6 | sys.path.append(pywpsPath) 7 | 8 | import pywps 9 | import pywps.Process 10 | import unittest 11 | from xml.dom import minidom 12 | import base64 13 | from osgeo import ogr 14 | import tempfile 15 | 16 | 17 | class ProcessesTestCase(unittest.TestCase): 18 | inputs = None 19 | getcapabilitiesrequest = "service=wps&request=getcapabilities" 20 | wpsns = "http://www.opengis.net/wps/1.0.0" 21 | xmldom = None 22 | 23 | def test01PYWPS_CFG(self): 24 | os.environ["PYWPS_CFG"] = os.path.abspath( 25 | os.path.join(pywpsPath, "tests", "pywps.cfg")) 26 | mypywps = pywps.Pywps(pywps.METHOD_GET) 27 | inputs = mypywps.parseRequest(self.getcapabilitiesrequest) 28 | mypywps.performRequest(inputs) 29 | xmldom = minidom.parseString(mypywps.response) 30 | 31 | self.assertEquals(xmldom.getElementsByTagName( 32 | "ows:Title")[0].firstChild.nodeValue, "Test") 33 | 34 | def test02PYWPS_PROCESSES(self): 35 | os.environ["PYWPS_PROCESSES"] = os.path.join( 36 | pywpsPath, "tests", "processes") 37 | mypywps = pywps.Pywps(pywps.METHOD_GET) 38 | inputs = mypywps.parseRequest(self.getcapabilitiesrequest) 39 | mypywps.performRequest(inputs) 40 | xmldom = minidom.parseString(mypywps.response) 41 | # print mypywps.response 42 | 43 | self.assertTrue( 44 | len(xmldom.getElementsByTagNameNS(self.wpsns, "Process")) > 0) 45 | 46 | def test03PYWPS_TEMPLATES(self): 47 | os.environ["PYWPS_TEMPLATES"] = os.path.join( 48 | pywpsPath, "tests", "Templates") 49 | mypywps = pywps.Pywps(pywps.METHOD_GET) 50 | inputs = mypywps.parseRequest(self.getcapabilitiesrequest) 51 | mypywps.performRequest(inputs) 52 | xmldom = minidom.parseString(mypywps.response) 53 | 54 | self.assertTrue(xmldom.getElementsByTagName("Test") > 0) 55 | 56 | 57 | if __name__ == "__main__": 58 | unittest.main() 59 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/exception.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | pywpsPath = os.path.abspath(os.path.join( 5 | os.path.split(os.path.abspath(__file__))[0], "..")) 6 | # sys.path.append(pywpsPath) 7 | sys.path[0] = pywpsPath 8 | 9 | import pywps 10 | import pywps.Process 11 | import unittest 12 | import os 13 | import urllib 14 | from xml.dom import minidom 15 | import base64 16 | import sys 17 | 18 | import tempfile 19 | 20 | 21 | class ExceptionTestCase(unittest.TestCase): 22 | tiffurl = "http://rsg.pml.ac.uk/wps/testdata/srtm_algarve.tif" # 3.2 megas 23 | wfsurl = "http://rsg.pml.ac.uk/geoserver2/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=rsg:areas_pw&maxFeatures=1" 24 | owsns = "http://www.opengis.net/ows/1.1" 25 | xmldom = None 26 | 27 | # NOTE: Depending on the code position where the exception is raised, the pywps.response maybe filled or not 28 | # for proper Exception debug it should be better to use a try: exception. 29 | # See: soap_testes.testSOAP11Fault 30 | 31 | def setUp(self): 32 | # Silence sterr otherwise the promopt is flooded with error message 33 | # from exceptions 34 | sys.stderr = open('/dev/null', "w") 35 | 36 | def testMaxFile(self): 37 | """Text exception raise from MaxFileSize""" 38 | # Calling complexRaster process that has datainput with 39 | # maxfilezie=2.0megas below 3mega of pywps.cfg 40 | 41 | self._setFromEnv() 42 | 43 | mypywps = pywps.Pywps(pywps.METHOD_GET) 44 | inputs = mypywps.parseRequest( 45 | "service=wps&request=execute&version=1.0.0&identifier=complexRaster&datainputs=[indata=%s]" % self.tiffurl) 46 | 47 | mypywps.performRequest() 48 | 49 | xmldom = minidom.parseString(mypywps.response) 50 | # Check that is an exception 51 | exceptionDOM = xmldom.getElementsByTagNameNS(self.owsns, "Exception") 52 | self.assertTrue(len(exceptionDOM) > 0) 53 | 54 | # Check that is FileSizeExceeded 55 | self.assertEqual(exceptionDOM[0].getAttribute( 56 | "exceptionCode"), "FileSizeExceeded") 57 | 58 | # Check that is 2.0 MB 59 | self.assertTrue("2.0" in exceptionDOM[0].getAttribute("locator")) 60 | 61 | # Calling complexprocess that has no maxfilesize, checking that pywps.cfg limit is respected 62 | # its is enough one raster input to raise the error 63 | inputs = mypywps.parseRequest( 64 | "service=wps&request=execute&version=1.0.0&identifier=complexprocess&datainputs=[rasterin=%s]" % (urllib.quote(self.tiffurl))) 65 | mypywps.performRequest() 66 | 67 | xmldom = minidom.parseString(mypywps.response) 68 | exceptionDOM = xmldom.getElementsByTagNameNS(self.owsns, "Exception") 69 | 70 | self.assertTrue(len(exceptionDOM) > 0) 71 | self.assertEqual(exceptionDOM[0].getAttribute( 72 | "exceptionCode"), "FileSizeExceeded") 73 | # Maximum file size is 3.0 MB for input 74 | self.assertTrue("3.0" in exceptionDOM[0].getAttribute("locator")) 75 | 76 | def _setFromEnv(self): 77 | os.putenv("PYWPS_PROCESSES", os.path.join( 78 | pywpsPath, "tests", "processes")) 79 | os.environ["PYWPS_PROCESSES"] = os.path.join( 80 | pywpsPath, "tests", "processes") 81 | os.putenv("PYWPS_CFG", os.path.join(pywpsPath, "pywps", "default")) 82 | os.environ["PYWPS_CFG"] = os.path.join( 83 | pywpsPath, "pywps", "default.cfg") 84 | 85 | if __name__ == "__main__": 86 | # unittest.main() 87 | suite = unittest.TestLoader().loadTestsFromTestCase(ExceptionTestCase) 88 | unittest.TextTestRunner(verbosity=2).run(suite) 89 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/process_inits.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | pywpsPath = os.path.abspath(os.path.join( 5 | os.path.split(os.path.abspath(__file__))[0], "..")) 6 | sys.path.append(pywpsPath) 7 | 8 | import pywps 9 | import pywps.Process 10 | import unittest 11 | import os 12 | from xml.dom import minidom 13 | 14 | 15 | class RequestGetTestCase(unittest.TestCase): 16 | inputs = None 17 | getcapabilitiesrequest = "service=wps&request=getcapabilities" 18 | getdescribeprocessrequest = "service=wps&request=describeprocess&version=1.0.0&identifier=dummyprocess" 19 | getexecuterequest = "service=wps&request=execute&version=1.0.0&identifier=dummyprocess&datainputs=[input1=20;input2=10]" 20 | wfsurl = "http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap?version=1.0.0&request=getfeature&service=wfs&typename=park" 21 | wpsns = "http://www.opengis.net/wps/1.0.0" 22 | xmldom = None 23 | 24 | def setUp(self): 25 | sys.stderr = open("/dev/null", "w") 26 | 27 | def testLoadProcessesFromClass(self): 28 | """Test, if we can load process as classes""" 29 | class newClassProcess(pywps.Process.WPSProcess): 30 | 31 | def __init__(self): 32 | pywps.Process.WPSProcess.__init__( 33 | self, identifier="foo", title="bar") 34 | 35 | mypywps = pywps.Pywps(pywps.METHOD_GET) 36 | inputs = mypywps.parseRequest(self.getcapabilitiesrequest) 37 | mypywps.performRequest(self.inputs, [newClassProcess]) 38 | xmldom = minidom.parseString(mypywps.response) 39 | self.assertTrue( 40 | len(xmldom.getElementsByTagNameNS(self.wpsns, "Process")) > 0) 41 | 42 | def testLoadProcessesAsInstance(self): 43 | """Test, if we can load process as instances""" 44 | class newClassProcess(pywps.Process.WPSProcess): 45 | 46 | def __init__(self): 47 | pywps.Process.WPSProcess.__init__( 48 | self, identifier="foo", title="bar") 49 | 50 | mypywps = pywps.Pywps(pywps.METHOD_GET) 51 | inputs = mypywps.parseRequest(self.getcapabilitiesrequest) 52 | mypywps.performRequest(self.inputs, [newClassProcess()]) 53 | xmldom = minidom.parseString(mypywps.response) 54 | self.assertTrue( 55 | len(xmldom.getElementsByTagNameNS(self.wpsns, "Process")) > 0) 56 | 57 | def testLoadProcessesFromEnvVar(self): 58 | """Test, if we can load processes set from PYWPS_PROCESSES 59 | environment variable""" 60 | self._setFromEnv() 61 | mypywps = pywps.Pywps(pywps.METHOD_GET) 62 | inputs = mypywps.parseRequest(self.getcapabilitiesrequest) 63 | mypywps.performRequest(inputs) 64 | xmldom = minidom.parseString(mypywps.response) 65 | self.assertEquals(len(mypywps.request.processes), 14) 66 | self.assertTrue(mypywps.request.getProcess("dummyprocess")) 67 | 68 | def _setFromEnv(self): 69 | os.putenv("PYWPS_PROCESSES", os.path.join( 70 | pywpsPath, "tests", "processes")) 71 | os.environ["PYWPS_PROCESSES"] = os.path.join( 72 | pywpsPath, "tests", "processes") 73 | 74 | 75 | if __name__ == "__main__": 76 | # unittest.main() 77 | suite = unittest.TestLoader().loadTestsFromTestCase(RequestGetTestCase) 78 | unittest.TextTestRunner(verbosity=2).run(suite) 79 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/processes/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["returner", "dummyprocess", "moreInOne", 2 | "moreInstancesInOne", "tests", "ultimatequestionprocess", "buffer"] 3 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/processes/dummyprocess.py: -------------------------------------------------------------------------------- 1 | """ 2 | DummyProcess to check the WPS structure 3 | 4 | Author: Jorge de Jesus (jorge.de-jesus@jrc.it) as suggested by Kor de Jong 5 | """ 6 | from pywps.Process import WPSProcess 7 | 8 | 9 | class Process(WPSProcess): 10 | 11 | def __init__(self): 12 | # init process 13 | WPSProcess.__init__(self, 14 | identifier="dummyprocess", # must be same, as filename 15 | title="Dummy Process", 16 | version="0.1", 17 | storeSupported="true", 18 | statusSupported="true", 19 | abstract="The Dummy process is used for testing the WPS structure. The process will accept 2 input numbers and will return the XML result with an add one and subtract one operation", 20 | grassLocation=False) 21 | 22 | self.Input1 = self.addLiteralInput(identifier="input1", 23 | title="Input1 number", 24 | default=100) 25 | self.Input2 = self.addLiteralInput(identifier="input2", 26 | title="Input2 number", 27 | default=200) 28 | self.Output1 = self.addLiteralOutput(identifier="output1", 29 | title="Output1 add 1 result") 30 | self.Output2 = self.addLiteralOutput( 31 | identifier="output2", title="Output2 subtract 1 result") 32 | 33 | def execute(self): 34 | 35 | self.Output1.setValue(self.Input1.getValue() + 1) 36 | self.Output2.setValue(self.Input1.getValue() - 1) 37 | return 38 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/processes/moreInOne.py: -------------------------------------------------------------------------------- 1 | from pywps.Process import WPSProcess 2 | 3 | 4 | class FirstProcess(WPSProcess): 5 | 6 | def __init__(self): 7 | WPSProcess.__init__(self, identifier="complexVector", 8 | title="First Process", 9 | abstract="Get vector imput and return it to output", 10 | statusSupported=True, 11 | storeSupported=True) 12 | 13 | self.indata = self.addComplexInput(identifier="indata", title="Complex in", formats=[ 14 | {"mimeType": "text/xml"}, {"mimeType": "application/xml"}], minOccurs=0, maxOccurs=1024) 15 | self.outdata = self.addComplexOutput( 16 | identifier="outdata", title="Complex out", formats=[{"mimeType": "text/xml"}]) 17 | self.outdata2 = self.addComplexOutput( 18 | identifier="outdata2", title="Complex out", formats=[{"mimeType": "application/xml"}]) 19 | 20 | def execute(self): 21 | # tmp=self.indata.getValue() 22 | # import pydevd;pydevd.settrace() 23 | # self.outdata.setValue(tmp) 24 | 25 | #import pydevd;pydevd.settrace() 26 | self.outdata.setValue(self.indata.getValue()[0]) 27 | self.outdata2.setValue(self.indata.getValue()[0]) 28 | 29 | 30 | class SecondProcess(WPSProcess): 31 | 32 | def __init__(self): 33 | WPSProcess.__init__(self, identifier="complexRaster", 34 | title="Second Process") 35 | 36 | self.indata = self.addComplexInput(identifier="indata", title="Complex in", 37 | formats=[{"mimeType": "image/tiff"}], maxmegabites=2) 38 | self.outdata = self.addComplexOutput(identifier="outdata", 39 | title="Complex out", formats=[{"mimeType": "image/tiff"}]) 40 | 41 | def execute(self): 42 | self.outdata.setValue(self.indata.getValue()) 43 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/processes/moreInstancesInOne.py: -------------------------------------------------------------------------------- 1 | from pywps.Process import WPSProcess 2 | 3 | myFirstProcess = WPSProcess(identifier="firstInstance", 4 | title="First instance process") 5 | 6 | mySecondProcess = WPSProcess(identifier="secondInstance", 7 | title="Second instance process") 8 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/processes/returner.py: -------------------------------------------------------------------------------- 1 | from pywps.Process import WPSProcess 2 | 3 | 4 | class Process(WPSProcess): 5 | 6 | def __init__(self): 7 | 8 | ## 9 | # Process initialization 10 | WPSProcess.__init__(self, 11 | identifier="returner", 12 | title="Return process", 13 | abstract="""This is demonstration process of PyWPS, returns the same file, it gets on input, as the output.""", 14 | version="1.0", 15 | storeSupported=True, 16 | statusSupported=True) 17 | 18 | ## 19 | # Adding process inputs 20 | 21 | self.dataIn = self.addComplexInput(identifier="data", 22 | title="Input vector data", 23 | formats=[{'mimeType': 'text/xml'}]) 24 | 25 | self.textIn = self.addLiteralInput(identifier="text", 26 | title="Some width") 27 | 28 | ## 29 | # Adding process outputs 30 | 31 | self.dataOut = self.addComplexOutput(identifier="output", 32 | title="Output vector data", 33 | formats=[{'mimeType': 'text/xml'}]) 34 | 35 | self.textOut = self.addLiteralOutput(identifier="text", 36 | title="Output literal data") 37 | 38 | ## 39 | # Execution part of the process 40 | def execute(self): 41 | 42 | # just copy the input values to output values 43 | self.dataOut.setValue(self.dataIn.getValue()) 44 | self.textOut.setValue(self.textIn.getValue()) 45 | 46 | return 47 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/processes/ultimatequestionprocess.py: -------------------------------------------------------------------------------- 1 | """ 2 | The ultimate process to test the status and update capabilities of the server 3 | The processes shoul be requested as follows: 4 | ../wps.py?request=execute 5 | &service=wps 6 | &version=1.0.0 7 | &identifier=ultimatequestionprocess 8 | &status=true 9 | &storeExecuteResponse=true 10 | 11 | Done by Jorge de Jesus (jmdj@pml.ac.uk) as suggested by Kor de Jong 12 | 13 | """ 14 | 15 | from pywps.Process import WPSProcess 16 | 17 | 18 | class Process(WPSProcess): 19 | 20 | def __init__(self): 21 | # init process 22 | WPSProcess.__init__(self, 23 | identifier="ultimatequestionprocess", # the same as the file name 24 | title="Answer to Life, the Universe and Everything", 25 | version="2.0", 26 | storeSupported=True, 27 | statusSupported=True, 28 | abstract="Numerical solution that is the answer to Life, Universe and Everything. The process is an improvement to Deep Tought computer (therefore version 2.0) since it no longer takes 7.5 milion years, but only a few seconds to give a response, with an update of status every 10 seconds.", 29 | grassLocation=False) 30 | # No need for inputs since Execute will start the process 31 | self.Answer = self.addLiteralOutput(identifier="answer", 32 | title="The numerical answer to Life, Universe and Everything") 33 | 34 | def execute(self): 35 | import time 36 | self.status.set("Preparing....", 0) 37 | for i in xrange(1, 11): 38 | time.sleep(2) 39 | self.status.set("Thinking.....", i * 10) 40 | # The final answer 41 | self.Answer.setValue("42") 42 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/HTTP_GET.txt: -------------------------------------------------------------------------------- 1 | # Following examples do try to describe possible usages of WPS, via HTTP 2 | # Get request. The examples do contain page reference in it's description, 3 | # to OGC WPS 05-007r7, to be found at 4 | # http://opengeospatial.org/standards/wps 5 | # 6 | # output as reference 7 | # resulting ComplexValues will be stored on the server, only URL will be 8 | # send back to client 9 | # 10 | # page 37, table 51, 11 | version=1.0.0&service=wps&request=execute&identifier=exampleBufferNoInputsProcess&responsedocument=[buffer=@asreference=true] 12 | 13 | # output part of Execute response 14 | # resulting ComplexValue will be part of Execute response - if it is binary 15 | # (raster) file, it will be stored in CDATA section 16 | # 17 | # page 37, table 51, 18 | version=1.0.0&service=wps&request=execute&identifier=exampleBufferNoInputsProcess&responsedocument=[buffer=@asreference=false] 19 | 20 | # lineage outputs 21 | # part of response document will be description of data outputs 22 | # 23 | # page 38, table 53, 24 | version=1.0.0&service=wps&request=execute&identifier=exampleBufferNoInputsProcess&responsedocument=[buffer=@asreference=true]&lineage=true 25 | 26 | # store execute response 27 | # the response document will be stored on the server for later reference 28 | # 29 | # page 38, table 53, 30 | version=1.0.0&service=wps&request=execute&identifier=exampleBufferNoInputsProcess&responsedocument=[buffer=@asreference=true]&StoreExecuteResponse=true 31 | 32 | # define output format for resulting raster map 33 | # this process can produce resulting map in image/png or image/tiff format, 34 | # choose one of them: 35 | version=1.0.0&service=wps&request=execute&identifier=exampleLosProcess&datainputs=[dem=http://localhost/temp/dem.tif;easting=603067.6875;northing=4925118.1875]&responsedocument=[los=@mimeType=image/png@asreference=true] 36 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_exception_SOAP11.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | I_am_not_here 11 | 12 | 13 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_exception_SOAP12.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | I_am_not_here 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | intersection 8 | union 9 | 10 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_request_SOAP11RPC.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ultimatequestionprocess 7 | 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_request_all.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | all 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_request_all_SOAP.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | all 11 | 12 | 13 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_describeprocess_request_dummyprocess.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | dummyprocess 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-bbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | bboxprocess 4 | 5 | 6 | bboxin 7 | BBOx in 8 | 9 | 10 | -11 -12 11 | 13 14 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-complexinput-as-reference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | complexprocess 4 | 5 | 6 | rasterin 7 | Input 8 | 9 | 10 | 11 | vectorin 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-complexinput-one-output-as-reference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | complexprocess 4 | 5 | 6 | vectorin 7 | Input 8 | 9 | 10 | 11 | 12 | rasterin 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | rasterout 21 | 22 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-complexinput-output-as-reference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | complexprocess 4 | 5 | 6 | vectorin 7 | Input 8 | 9 | 10 | 11 | rasterin 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | rasterout 20 | 21 | 22 | vectorout 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-literalinput-responsedocument.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | literalprocess 12 | 13 | 14 | int 15 | 16 | 1 17 | 18 | 19 | 20 | string 21 | 22 | spam 23 | 24 | 25 | 26 | float 27 | 28 | 1.1 29 | 30 | 31 | 32 | zeroset 33 | 34 | 0 35 | 36 | 37 | 38 | bool 39 | 40 | False 41 | 42 | 43 | 44 | 45 | 46 | 47 | int 48 | 49 | 50 | float 51 | 52 | 53 | bool 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-literalinput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | literalprocess 12 | 13 | 14 | int 15 | 16 | 1 17 | 18 | 19 | 20 | string 21 | 22 | spam@foo.com 23 | 24 | 25 | 26 | float 27 | 28 | 1.1 29 | 30 | 31 | 32 | zeroset 33 | 34 | 0 35 | 36 | 37 | 38 | bool 39 | 40 | False 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-noinputs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | noinputprocess 12 | 13 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-rawdataoutput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | buffer 16 | 17 | 18 | data 19 | Input 20 | 21 | 22 | 23 | width 24 | buffer width 25 | 26 | 400 27 | 28 | 29 | 30 | 31 | 32 | text 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request-responsedocument.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | exampleBufferProcess 16 | 17 | 18 | data 19 | Input 20 | 21 | 22 | 23 | width 24 | buffer width 25 | 26 | 4 27 | 28 | 29 | 30 | 31 | 32 | 33 | buffer 34 | 35 | 36 | bufferRaster 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request_compress_SOAP.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 100 11 | 200 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request_flags_compress_SOAP.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 10 9 | 20 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request_reference_lineage.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | lineagereturn 7 | 8 | 9 | vectorin 10 | 11 | 12 | 13 | vectorin 14 | Input 15 | 16 | 17 | 18 | rasterin 19 | Input 20 | 21 | 22 | 23 | rasterin 24 | Input 25 | 26 | 27 | 28 | bboxin 29 | BBOx in 30 | 31 | 32 | -9 -3 33 | 11 13 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request_ultimate_compress_SOAP.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_execute_request_ultimatequestion_SOAP.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | ultimatequestionprocess 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_getcapabilities_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 1.0.0 11 | 12 | 13 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_getcapabilities_request_SOAP11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | 12 | 15 | 16 | 21 | 22 | 1.0.0 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_getcapabilities_request_SOAP11RPC.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 1.0.0 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /filters/PyWPS/tests/requests/wps_getcapabilities_request_SOAP12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 14 | 15 | 19 | 20 | 1.0.0 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /filters/PyWPS/webclient/01-init.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | WPS Client - Initialization and GetCapabilities 9 | 10 | 11 | 12 | 56 | 57 | 58 |

WPS Client - Initialization and GetCapabilities

59 |

60 | Example of usage of the PyWPS WPS.js client 61 | initialization and GetCapabilities parser. 62 |

63 |
64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /filters/PyWPS/webclient/02-describe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | WPS Client - DescribeProcess 9 | 10 | 11 | 12 | 65 | 66 | 67 |

WPS Client - DescribeProcess

68 |

69 | Example of usage of the PyWPS WPS.js client 70 | DescribeProcess parser. 71 |

72 |
73 |
74 | 75 | 76 | -------------------------------------------------------------------------------- /filters/PyWPS/webclient/03-execute.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | WPS Client - Execute 9 | 10 | 11 | 12 | 70 | 71 | 72 |

WPS Client - Execute

73 |

74 | Example of usage of the PyWPS WPS.js client 75 | Execute parser. 76 |

77 |
78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /filters/PyWPS/webclient/04-execute-automatic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | WPS Client - Execute (automatic) 9 | 10 | 11 | 12 | 68 | 69 | 70 |

WPS Client - Execute (automatic)

71 |

72 | Example of usage of the PyWPS WPS.js client 73 | Execute parser. 74 |

75 |
76 |
77 | 78 | 79 | -------------------------------------------------------------------------------- /filters/PyWPS/webservices/cgi/pywps.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: Jachym Cepicky 4 | # Purpose: CGI script for wrapping PyWPS script 5 | # Licence: GNU/GPL 6 | # Usage: Put this script to your web server cgi-bin directory, e.g. 7 | # /usr/lib/cgi-bin/ and make it executable (chmod 755 pywps.cgi) 8 | 9 | # NOTE: tested on linux/apache 10 | 11 | export PYWPS_CFG=/usr/local/wps/pywps.cfg 12 | export PYWPS_PROCESSES=/usr/local/wps/processes/ 13 | 14 | /usr/local/pywps-VERSION/wps.py 15 | -------------------------------------------------------------------------------- /filters/PyWPS/webservices/mod_python/.htaccess: -------------------------------------------------------------------------------- 1 | SetEnv PYWPS_PROCESSES /usr/local/wps/processes 2 | SetEnv PYWPS_CFG /usr/local/wps/pywps.cfg 3 | SetHandler python-program 4 | PythonHandler pywps 5 | PythonDebug On 6 | PythonPath "sys.path+['/usr/local/pywps-VERSION/']" 7 | PythonAutoReload On 8 | -------------------------------------------------------------------------------- /filters/PyWPS/webservices/mod_python/wps.py: -------------------------------------------------------------------------------- 1 | """ 2 | PyWPS mod_python script 3 | 4 | Do not forget to add following configuration to your .htaccess file or 5 | server configuration file:: 6 | 7 | SetEnv PYWPS_PROCESSES /usr/local/wps/processes/ 8 | SetEnv PYWPS_CFG /usr/local/wps/pywps.cfg 9 | SetHandler python-program 10 | PythonHandler wps 11 | PythonDebug On 12 | PythonPath "sys.path+['/usr/local/pywps-VERSION/']" 13 | PythonAutoReload On 14 | 15 | .. moduleauthor: Jachym Cepicky jachym bnhelp cz 16 | """ 17 | 18 | # Author: Jachym Cepicky 19 | # http://les-ejk.cz 20 | # License: 21 | # 22 | # Web Processing Service implementation 23 | # Copyright (C) 2006 Jachym Cepicky 24 | # 25 | # This program is free software; you can redistribute it and/or modify 26 | # it under the terms of the GNU General Public License as published by 27 | # the Free Software Foundation; either version 2 of the License. 28 | # 29 | # This program is distributed in the hope that it will be useful, 30 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 31 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 32 | # GNU General Public License for more details. 33 | # 34 | # You should have received a copy of the GNU General Public License 35 | # along with this program; if not, write to the Free Software 36 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 37 | # 02110-1301 USA 38 | 39 | from mod_python import apache 40 | import pywps 41 | import pywps.response 42 | from pywps.Exceptions import * 43 | import traceback 44 | import os 45 | 46 | #from pywps.Exceptions import * 47 | 48 | 49 | def handler(req): 50 | 51 | inputQuery = None 52 | if req.method == "GET": 53 | inputQuery = req.args 54 | else: 55 | inputQuery = req 56 | 57 | if not inputQuery: 58 | err = NoApplicableCode("No query string found.") 59 | pywps.response.response(err, req) 60 | return apache.OK 61 | 62 | # set PYWPS_CFG and PYWPS_PROCESSES environment variable, which can not 63 | # bee seen from mod_python 64 | env_vars = req.subprocess_env.copy() 65 | if env_vars.has_key("PYWPS_CFG"): 66 | os.environ["PYWPS_CFG"] = env_vars["PYWPS_CFG"] 67 | if env_vars.has_key("PYWPS_PROCESSES"): 68 | os.environ["PYWPS_PROCESSES"] = env_vars["PYWPS_PROCESSES"] 69 | 70 | # create the WPS object 71 | try: 72 | wps = pywps.Pywps(req.method) 73 | if wps.parseRequest(inputQuery): 74 | pywps.debug(wps.inputs) 75 | wps.performRequest() 76 | pywps.response.response(wps.response, req, 77 | wps.parser.isSoap, self.wps.parser.isSoapExecute, contentType=wps.request.contentType) 78 | return apache.OK 79 | except WPSException, e: 80 | pywps.response.response(e, req) 81 | return apache.OK 82 | except Exception, e: 83 | req.content_type = "text/plain" 84 | traceback.print_exc(file=req) 85 | return apache.OK 86 | -------------------------------------------------------------------------------- /filters/PyWPS/webservices/tomcat/PywpsServlet.py: -------------------------------------------------------------------------------- 1 | """PyWPS Jython (Java) servlet implementation 2 | 3 | .. moduleauthor: Jachym Cepicky 4 | """ 5 | 6 | from java.io import * 7 | from javax.servlet.http import HttpServlet 8 | 9 | import pywps 10 | from pywps.Exceptions import * 11 | import traceback 12 | import sys 13 | 14 | 15 | class PywspServlet(HttpServlet): 16 | 17 | def doGet(self, request, response): 18 | 19 | inputQuery = request.getQueryString() 20 | if not inputQuery: 21 | e = NoApplicableCode("Missing request value") 22 | pywps.response.response(e, response) 23 | self.doPywps(request, response, inputQuery, pywps.METHOD_GET) 24 | 25 | def doPost(self, request, response): 26 | 27 | inputQuery = request.getQueryString() 28 | self.doPywps(request, response, inputQuery, pywps.METHOD_POST) 29 | 30 | def doPywps(self, request, response, inputQuery, method): 31 | 32 | # create the WPS object 33 | try: 34 | wps = pywps.Pywps(method) 35 | if wps.parseRequest(inputQuery): 36 | pywps.debug(wps.inputs) 37 | wpsresponse = wps.performRequest( 38 | processes=[self.getProcesses()]) 39 | if wpsresponse: 40 | pywps.response.response( 41 | wps.response, response, wps.parser.isSoap, self.wps.parser.isSoapExecute) 42 | except WPSException, e: 43 | pywps.response.response(e, response) 44 | 45 | def getProcesses(self): 46 | """Create temporary Process with literal input and output""" 47 | 48 | from pywps.Process import WPSProcess 49 | 50 | process = WPSProcess(identifier="servletProcess", 51 | title="Java Servlet process") 52 | process.addLiteralInput(identifier="input", 53 | title="Literal input") 54 | process.addLiteralOutput(identifier="output", 55 | title="Literal output") 56 | 57 | def execute(): 58 | self.outputs["output"].setValue(self.inputs["input"].getValue()) 59 | 60 | process.execute = execute() 61 | 62 | return process 63 | -------------------------------------------------------------------------------- /filters/PyWPS/webservices/tomcat/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | PyWPS 4 | 28 | 29 | index.html 30 | index.htm 31 | index.jsp 32 | default.html 33 | default.htm 34 | default.jsp 35 | 36 | 37 | PyServlet 38 | org.python.util.PyServlet 39 | 1 40 | 41 | 42 | PyServlet 43 | *.py 44 | 45 | 46 | -------------------------------------------------------------------------------- /filters/PyWPS/webservices/wsgi/wsgiwps.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | PyWPS wsgi script 5 | 6 | SetHandler python-program 7 | PythonHandler wps 8 | PythonDebug On 9 | PythonPath "sys.path+['/usr/local/pywps-VERSION/']" 10 | PythonAutoReload On 11 | 12 | .. moduleauthor: Jachym Cepicky jachym bnhelp cz 13 | """ 14 | 15 | # Author: Jachym Cepicky 16 | # http://les-ejk.cz 17 | # License: 18 | # 19 | # Web Processing Service implementation 20 | # Copyright (C) 2006 Jachym Cepicky 21 | # 22 | # This program is free software; you can redistribute it and/or modify 23 | # it under the terms of the GNU General Public License as published by 24 | # the Free Software Foundation; either version 2 of the License. 25 | # 26 | # This program is distributed in the hope that it will be useful, 27 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | # GNU General Public License for more details. 30 | # 31 | # You should have received a copy of the GNU General Public License 32 | # along with this program; if not, write to the Free Software 33 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 34 | # 02110-1301 USA 35 | 36 | import pywps 37 | from pywps.Exceptions import * 38 | 39 | 40 | def application(environ, start_response): 41 | 42 | status = '200 OK' 43 | response_headers = [('Content-type', 'text/xml')] 44 | start_response(status, response_headers) 45 | 46 | inputQuery = None 47 | if "REQUEST_METHOD" in environ and environ["REQUEST_METHOD"] == "GET": 48 | inputQuery = environ["QUERY_STRING"] 49 | elif "wsgi.input" in environ: 50 | inputQuery = environ['wsgi.input'] 51 | 52 | if not inputQuery: 53 | err = NoApplicableCode("No query string found.") 54 | return [err.getResponse()] 55 | 56 | # create the WPS object 57 | try: 58 | wps = pywps.Pywps(environ["REQUEST_METHOD"]) 59 | if wps.parseRequest(inputQuery): 60 | pywps.debug(wps.inputs) 61 | wps.performRequest() 62 | return wps.response 63 | except WPSException, e: 64 | return [e] 65 | except Exception, e: 66 | return [e] 67 | 68 | 69 | if __name__ == '__main__': 70 | 71 | import os 72 | 73 | # import processes from the tests directory 74 | os.environ["PYWPS_PROCESSES"] = os.path.join( 75 | os.path.split( 76 | os.path.dirname( 77 | pywps.__file__ 78 | ) 79 | )[0], "tests", "processes") 80 | 81 | from wsgiref.simple_server import make_server 82 | srv = make_server('localhost', 8081, application) 83 | srv.serve_forever() 84 | -------------------------------------------------------------------------------- /filters/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /help/source/index.rst: -------------------------------------------------------------------------------- 1 | .. wps4server documentation master file, created by 2 | sphinx-quickstart on Sun Feb 12 17:11:03 2012. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to wps4server's documentation! 7 | ============================================ 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | Indices and tables 15 | ================== 16 | 17 | * :ref:`genindex` 18 | * :ref:`modindex` 19 | * :ref:`search` 20 | 21 | -------------------------------------------------------------------------------- /i18n/af.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @default 5 | 6 | 7 | Good morning 8 | Goeie more 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3liz/qgis-wps4server/421a07b1e92abe470d3a2a133a334bb1b5dc2d61/icon.png -------------------------------------------------------------------------------- /metadata.txt: -------------------------------------------------------------------------------- 1 | # This file contains metadata for your plugin. Since 2 | # version 2.0 of QGIS this is the proper way to supply 3 | # information about a plugin. The old method of 4 | # embedding metadata in __init__.py will 5 | # is no longer supported since version 2.0. 6 | 7 | # This file should be included when you package your plugin.# Mandatory items: 8 | 9 | [general] 10 | name=wps4server 11 | qgisMinimumVersion=2.14 12 | description=OGC Web Processing Service for QGIS Server 13 | version=1.0.7 14 | author=DHONT René-Luc (3Liz) 15 | email=rldhont@3liz.com 16 | ; if True it's a server plugin 17 | server=True 18 | 19 | about=wps4server add OGC Web Processing Service capabilities to QGIS server 20 | 21 | tracker=http://github.com/3liz/qgis-wps4server/issues 22 | repository=http://github.com/3liz/qgis-wps4server 23 | # End of mandatory metadata 24 | 25 | # Recommended items: 26 | 27 | # Uncomment the following line and add your changelog: 28 | # changelog= 29 | 30 | # Tags are comma separated with spaces allowed 31 | tags=server, wps, ogc 32 | 33 | homepage=http://github.com/3liz/qgis-wps4server 34 | category=server 35 | icon=icon.png 36 | # experimental flag 37 | experimental=False 38 | 39 | # deprecated flag (applies to the whole plugin, not just a single version) 40 | deprecated=False 41 | 42 | -------------------------------------------------------------------------------- /pb_tool.cfg: -------------------------------------------------------------------------------- 1 | #/*************************************************************************** 2 | # wps4server 3 | # 4 | # Configuration file for plugin builder tool (pb_tool) 5 | # ------------------- 6 | # begin : 2015-08-26 7 | # copyright : (C) 2015 by DHONT René-Luc / 3Liz 8 | # email : rldhont@3liz.com 9 | # ***************************************************************************/ 10 | # 11 | #/*************************************************************************** 12 | # * * 13 | # * This program is free software; you can redistribute it and/or modify * 14 | # * it under the terms of the GNU General Public License as published by * 15 | # * the Free Software Foundation; either version 2 of the License, or * 16 | # * (at your option) any later version. * 17 | # * * 18 | # ***************************************************************************/ 19 | # 20 | # 21 | # You can install pb_tool using: 22 | # pip install http://geoapt.net/files/pb_tool.zip 23 | # 24 | # Consider doing your development (and install of pb_tool) in a virtualenv. 25 | # 26 | # For details on setting up and using pb_tool, see: 27 | # http://spatialgalaxy.net/qgis-plugin-development-with-pb_tool 28 | # 29 | # Issues and pull requests here: 30 | # https://github.com/g-sherman/plugin_build_tool: 31 | # 32 | # Sane defaults for your plugin generated by the Plugin Builder are 33 | # already set below. 34 | # 35 | # As you add Python source files and UI files to your plugin, add 36 | # them to the appropriate [files] section below. 37 | 38 | [plugin] 39 | # Name of the plugin. This is the name of the directory that will 40 | # be created in .qgis2/python/plugins 41 | name: wps4server 42 | 43 | [files] 44 | # Python files that should be deployed with the plugin 45 | python_files: __init__.py wps4server.py wps4server_dialog.py 46 | 47 | # The main dialog file that is loaded (not compiled) 48 | main_dialog: wps4server_dialog_base.ui 49 | 50 | # Other ui files for dialogs you create (these will be compiled) 51 | compiled_ui_files: 52 | 53 | # Resource file(s) that will be compiled 54 | resource_files: resources.qrc 55 | 56 | # Other files required for the plugin 57 | extras: metadata.txt icon.png 58 | 59 | # Other directories to be deployed with the plugin. 60 | # These must be subdirectories under the plugin directory 61 | extra_dirs: 62 | 63 | # ISO code(s) for any locales (translations), separated by spaces. 64 | # Corresponding .ts files must exist in the i18n directory 65 | locales: 66 | 67 | [help] 68 | # the built help directory that should be deployed with the plugin 69 | dir: help/build/html 70 | # the name of the directory to target in the deployed plugin 71 | target: help 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /plugin_upload.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | """This script uploads a plugin package on the server. 4 | Authors: A. Pasotti, V. Picavet 5 | git sha : $TemplateVCSFormat 6 | """ 7 | 8 | import sys 9 | import getpass 10 | import xmlrpclib 11 | from optparse import OptionParser 12 | 13 | # Configuration 14 | PROTOCOL = 'http' 15 | SERVER = 'plugins.qgis.org' 16 | PORT = '80' 17 | ENDPOINT = '/plugins/RPC2/' 18 | VERBOSE = False 19 | 20 | 21 | def main(parameters, arguments): 22 | """Main entry point. 23 | 24 | :param parameters: Command line parameters. 25 | :param arguments: Command line arguments. 26 | """ 27 | address = "%s://%s:%s@%s:%s%s" % ( 28 | PROTOCOL, 29 | parameters.username, 30 | parameters.password, 31 | parameters.server, 32 | parameters.port, 33 | ENDPOINT) 34 | print "Connecting to: %s" % hide_password(address) 35 | 36 | server = xmlrpclib.ServerProxy(address, verbose=VERBOSE) 37 | 38 | try: 39 | plugin_id, version_id = server.plugin.upload( 40 | xmlrpclib.Binary(open(arguments[0]).read())) 41 | print "Plugin ID: %s" % plugin_id 42 | print "Version ID: %s" % version_id 43 | except xmlrpclib.ProtocolError, err: 44 | print "A protocol error occurred" 45 | print "URL: %s" % hide_password(err.url, 0) 46 | print "HTTP/HTTPS headers: %s" % err.headers 47 | print "Error code: %d" % err.errcode 48 | print "Error message: %s" % err.errmsg 49 | except xmlrpclib.Fault, err: 50 | print "A fault occurred" 51 | print "Fault code: %d" % err.faultCode 52 | print "Fault string: %s" % err.faultString 53 | 54 | 55 | def hide_password(url, start=6): 56 | """Returns the http url with password part replaced with '*'. 57 | 58 | :param url: URL to upload the plugin to. 59 | :type url: str 60 | 61 | :param start: Position of start of password. 62 | :type start: int 63 | """ 64 | start_position = url.find(':', start) + 1 65 | end_position = url.find('@') 66 | return "%s%s%s" % ( 67 | url[:start_position], 68 | '*' * (end_position - start_position), 69 | url[end_position:]) 70 | 71 | 72 | if __name__ == "__main__": 73 | parser = OptionParser(usage="%prog [options] plugin.zip") 74 | parser.add_option( 75 | "-w", "--password", dest="password", 76 | help="Password for plugin site", metavar="******") 77 | parser.add_option( 78 | "-u", "--username", dest="username", 79 | help="Username of plugin site", metavar="user") 80 | parser.add_option( 81 | "-p", "--port", dest="port", 82 | help="Server port to connect to", metavar="80") 83 | parser.add_option( 84 | "-s", "--server", dest="server", 85 | help="Specify server name", metavar="plugins.qgis.org") 86 | options, args = parser.parse_args() 87 | if len(args) != 1: 88 | print "Please specify zip file.\n" 89 | parser.print_help() 90 | sys.exit(1) 91 | if not options.server: 92 | options.server = SERVER 93 | if not options.port: 94 | options.port = PORT 95 | if not options.username: 96 | # interactive mode 97 | username = getpass.getuser() 98 | print "Please enter user name [%s] :" % username, 99 | res = raw_input() 100 | if res != "": 101 | options.username = res 102 | else: 103 | options.username = username 104 | if not options.password: 105 | # interactive mode 106 | options.password = getpass.getpass() 107 | main(options, args) 108 | -------------------------------------------------------------------------------- /resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /scripts/compile-strings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | LRELEASE=$1 3 | LOCALES=$2 4 | 5 | 6 | for LOCALE in ${LOCALES} 7 | do 8 | echo "Processing: ${LOCALE}.ts" 9 | # Note we don't use pylupdate with qt .pro file approach as it is flakey 10 | # about what is made available. 11 | $LRELEASE i18n/${LOCALE}.ts 12 | done 13 | -------------------------------------------------------------------------------- /scripts/run-env-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | QGIS_PREFIX_PATH=/usr/local/qgis-2.0 4 | if [ -n "$1" ]; then 5 | QGIS_PREFIX_PATH=$1 6 | fi 7 | 8 | echo ${QGIS_PREFIX_PATH} 9 | 10 | 11 | export QGIS_PREFIX_PATH=${QGIS_PREFIX_PATH} 12 | export QGIS_PATH=${QGIS_PREFIX_PATH} 13 | export LD_LIBRARY_PATH=${QGIS_PREFIX_PATH}/lib 14 | export PYTHONPATH=${QGIS_PREFIX_PATH}/share/qgis/python:${QGIS_PREFIX_PATH}/share/qgis/python/plugins:${PYTHONPATH} 15 | 16 | echo "QGIS PATH: $QGIS_PREFIX_PATH" 17 | export QGIS_DEBUG=0 18 | export QGIS_LOG_FILE=/tmp/inasafe/realtime/logs/qgis.log 19 | 20 | export PATH=${QGIS_PREFIX_PATH}/bin:$PATH 21 | 22 | echo "This script is intended to be sourced to set up your shell to" 23 | echo "use a QGIS 2.0 built in $QGIS_PREFIX_PATH" 24 | echo 25 | echo "To use it do:" 26 | echo "source $BASH_SOURCE /your/optional/install/path" 27 | echo 28 | echo "Then use the make file supplied here e.g. make guitest" 29 | -------------------------------------------------------------------------------- /scripts/update-strings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | LOCALES=$* 3 | 4 | # Get newest .py files so we don't update strings unnecessarily 5 | 6 | CHANGED_FILES=0 7 | PYTHON_FILES=`find . -regex ".*\(ui\|py\)$" -type f` 8 | for PYTHON_FILE in $PYTHON_FILES 9 | do 10 | CHANGED=$(stat -c %Y $PYTHON_FILE) 11 | if [ ${CHANGED} -gt ${CHANGED_FILES} ] 12 | then 13 | CHANGED_FILES=${CHANGED} 14 | fi 15 | done 16 | 17 | # Qt translation stuff 18 | # for .ts file 19 | UPDATE=false 20 | for LOCALE in ${LOCALES} 21 | do 22 | TRANSLATION_FILE="i18n/$LOCALE.ts" 23 | if [ ! -f ${TRANSLATION_FILE} ] 24 | then 25 | # Force translation string collection as we have a new language file 26 | touch ${TRANSLATION_FILE} 27 | UPDATE=true 28 | break 29 | fi 30 | 31 | MODIFICATION_TIME=$(stat -c %Y ${TRANSLATION_FILE}) 32 | if [ ${CHANGED_FILES} -gt ${MODIFICATION_TIME} ] 33 | then 34 | # Force translation string collection as a .py file has been updated 35 | UPDATE=true 36 | break 37 | fi 38 | done 39 | 40 | if [ ${UPDATE} == true ] 41 | # retrieve all python files 42 | then 43 | print ${PYTHON_FILES} 44 | # update .ts 45 | echo "Please provide translations by editing the translation files below:" 46 | for LOCALE in ${LOCALES} 47 | do 48 | echo "i18n/"${LOCALE}".ts" 49 | # Note we don't use pylupdate with qt .pro file approach as it is flakey 50 | # about what is made available. 51 | pylupdate4 -noobsolete ${PYTHON_FILES} -ts i18n/${LOCALE}.ts 52 | done 53 | else 54 | echo "No need to edit any translation files (.ts) because no python files" 55 | echo "has been updated since the last update translation. " 56 | fi 57 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | # import qgis libs so that ve set the correct sip api version 2 | import qgis # pylint: disable=W0611 # NOQA -------------------------------------------------------------------------------- /test/tenbytenraster.asc: -------------------------------------------------------------------------------- 1 | NCOLS 10 2 | NROWS 10 3 | XLLCENTER 1535380.000000 4 | YLLCENTER 5083260.000000 5 | DX 10 6 | DY 10 7 | NODATA_VALUE -9999 8 | 0 1 2 3 4 5 6 7 8 9 9 | 0 1 2 3 4 5 6 7 8 9 10 | 0 1 2 3 4 5 6 7 8 9 11 | 0 1 2 3 4 5 6 7 8 9 12 | 0 1 2 3 4 5 6 7 8 9 13 | 0 1 2 3 4 5 6 7 8 9 14 | 0 1 2 3 4 5 6 7 8 9 15 | 0 1 2 3 4 5 6 7 8 9 16 | 0 1 2 3 4 5 6 7 8 9 17 | 0 1 2 3 4 5 6 7 8 9 18 | CRS 19 | NOTES 20 | -------------------------------------------------------------------------------- /test/tenbytenraster.asc.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Point 4 | 5 | 6 | 7 | 9 8 | 4.5 9 | 0 10 | 2.872281323269 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/tenbytenraster.keywords: -------------------------------------------------------------------------------- 1 | title: Tenbytenraster 2 | -------------------------------------------------------------------------------- /test/tenbytenraster.lic: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tim Sutton, Linfiniti Consulting CC 5 | 6 | 7 | 8 | tenbytenraster.asc 9 | 2700044251 10 | Yes 11 | Tim Sutton 12 | Tim Sutton (QGIS Source Tree) 13 | Tim Sutton 14 | This data is publicly available from QGIS Source Tree. The original 15 | file was created and contributed to QGIS by Tim Sutton. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/tenbytenraster.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /test/tenbytenraster.qml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 0 26 | 27 | -------------------------------------------------------------------------------- /test/test_init.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Tests QGIS plugin init.""" 3 | 4 | __author__ = 'Tim Sutton ' 5 | __revision__ = '$Format:%H$' 6 | __date__ = '17/10/2010' 7 | __license__ = "GPL" 8 | __copyright__ = 'Copyright 2012, Australia Indonesia Facility for ' 9 | __copyright__ += 'Disaster Reduction' 10 | 11 | import os 12 | import unittest 13 | import logging 14 | import ConfigParser 15 | 16 | LOGGER = logging.getLogger('QGIS') 17 | 18 | 19 | class TestInit(unittest.TestCase): 20 | """Test that the plugin init is usable for QGIS. 21 | 22 | Based heavily on the validator class by Alessandro 23 | Passoti available here: 24 | 25 | http://github.com/qgis/qgis-django/blob/master/qgis-app/ 26 | plugins/validator.py 27 | 28 | """ 29 | 30 | def test_read_init(self): 31 | """Test that the plugin __init__ will validate on plugins.qgis.org.""" 32 | 33 | # You should update this list according to the latest in 34 | # https://github.com/qgis/qgis-django/blob/master/qgis-app/ 35 | # plugins/validator.py 36 | 37 | required_metadata = [ 38 | 'name', 39 | 'description', 40 | 'version', 41 | 'qgisMinimumVersion', 42 | 'email', 43 | 'author'] 44 | 45 | file_path = os.path.abspath(os.path.join( 46 | os.path.dirname(__file__), os.pardir, 47 | 'metadata.txt')) 48 | LOGGER.info(file_path) 49 | metadata = [] 50 | parser = ConfigParser.ConfigParser() 51 | parser.optionxform = str 52 | parser.read(file_path) 53 | message = 'Cannot find a section named "general" in %s' % file_path 54 | assert parser.has_section('general'), message 55 | metadata.extend(parser.items('general')) 56 | 57 | for expectation in required_metadata: 58 | message = ('Cannot find metadata "%s" in metadata source (%s).' % ( 59 | expectation, file_path)) 60 | 61 | self.assertIn(expectation, dict(metadata), message) 62 | 63 | if __name__ == '__main__': 64 | unittest.main() 65 | -------------------------------------------------------------------------------- /test/test_qgis_environment.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Tests for QGIS functionality. 3 | 4 | 5 | .. note:: This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | """ 11 | __author__ = 'tim@linfiniti.com' 12 | __date__ = '20/01/2011' 13 | __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 14 | 'Disaster Reduction') 15 | 16 | import os 17 | import unittest 18 | from qgis.core import ( 19 | QgsProviderRegistry, 20 | QgsCoordinateReferenceSystem, 21 | QgsRasterLayer) 22 | 23 | from utilities import get_qgis_app 24 | QGIS_APP = get_qgis_app() 25 | 26 | 27 | class QGISTest(unittest.TestCase): 28 | """Test the QGIS Environment""" 29 | 30 | def test_qgis_environment(self): 31 | """QGIS environment has the expected providers""" 32 | 33 | r = QgsProviderRegistry.instance() 34 | self.assertIn('gdal', r.providerList()) 35 | self.assertIn('ogr', r.providerList()) 36 | self.assertIn('postgres', r.providerList()) 37 | 38 | def test_projection(self): 39 | """Test that QGIS properly parses a wkt string. 40 | """ 41 | crs = QgsCoordinateReferenceSystem() 42 | wkt = ( 43 | 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",' 44 | 'SPHEROID["WGS_1984",6378137.0,298.257223563]],' 45 | 'PRIMEM["Greenwich",0.0],UNIT["Degree",' 46 | '0.0174532925199433]]') 47 | crs.createFromWkt(wkt) 48 | auth_id = crs.authid() 49 | expected_auth_id = 'EPSG:4326' 50 | self.assertEqual(auth_id, expected_auth_id) 51 | 52 | # now test for a loaded layer 53 | path = os.path.join(os.path.dirname(__file__), 'tenbytenraster.asc') 54 | title = 'TestRaster' 55 | layer = QgsRasterLayer(path, title) 56 | auth_id = layer.crs().authid() 57 | self.assertEqual(auth_id, expected_auth_id) 58 | 59 | if __name__ == '__main__': 60 | unittest.main() 61 | -------------------------------------------------------------------------------- /test/test_resources.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Resources test. 3 | 4 | .. note:: This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | """ 10 | 11 | __author__ = 'rldhont@3liz.com' 12 | __date__ = '2015-08-26' 13 | __copyright__ = 'Copyright 2015, DHONT René-Luc / 3Liz' 14 | 15 | import unittest 16 | 17 | from PyQt4.QtGui import QIcon 18 | 19 | 20 | 21 | class wps4serverDialogTest(unittest.TestCase): 22 | """Test rerources work.""" 23 | 24 | def setUp(self): 25 | """Runs before each test.""" 26 | pass 27 | 28 | def tearDown(self): 29 | """Runs after each test.""" 30 | pass 31 | 32 | def test_icon_png(self): 33 | """Test we can click OK.""" 34 | path = ':/plugins/wps4server/icon.png' 35 | icon = QIcon(path) 36 | self.assertFalse(icon.isNull()) 37 | 38 | if __name__ == "__main__": 39 | suite = unittest.makeSuite(wps4serverResourcesTest) 40 | runner = unittest.TextTestRunner(verbosity=2) 41 | runner.run(suite) 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test/test_translations.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Safe Translations Test. 3 | 4 | .. note:: This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | """ 10 | from utilities import get_qgis_app 11 | 12 | __author__ = 'ismailsunni@yahoo.co.id' 13 | __date__ = '12/10/2011' 14 | __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 15 | 'Disaster Reduction') 16 | import unittest 17 | import os 18 | 19 | from PyQt4.QtCore import QCoreApplication, QTranslator 20 | 21 | QGIS_APP = get_qgis_app() 22 | 23 | 24 | class SafeTranslationsTest(unittest.TestCase): 25 | """Test translations work.""" 26 | 27 | def setUp(self): 28 | """Runs before each test.""" 29 | if 'LANG' in os.environ.iterkeys(): 30 | os.environ.__delitem__('LANG') 31 | 32 | def tearDown(self): 33 | """Runs after each test.""" 34 | if 'LANG' in os.environ.iterkeys(): 35 | os.environ.__delitem__('LANG') 36 | 37 | def test_qgis_translations(self): 38 | """Test that translations work.""" 39 | parent_path = os.path.join(__file__, os.path.pardir, os.path.pardir) 40 | dir_path = os.path.abspath(parent_path) 41 | file_path = os.path.join( 42 | dir_path, 'i18n', 'af.qm') 43 | translator = QTranslator() 44 | translator.load(file_path) 45 | QCoreApplication.installTranslator(translator) 46 | 47 | expected_message = 'Goeie more' 48 | real_message = QCoreApplication.translate("@default", 'Good morning') 49 | self.assertEqual(real_message, expected_message) 50 | 51 | 52 | if __name__ == "__main__": 53 | suite = unittest.makeSuite(SafeTranslationsTest) 54 | runner = unittest.TextTestRunner(verbosity=2) 55 | runner.run(suite) 56 | -------------------------------------------------------------------------------- /test/test_wps4server_dialog.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Dialog test. 3 | 4 | .. note:: This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | """ 10 | 11 | __author__ = 'rldhont@3liz.com' 12 | __date__ = '2015-08-26' 13 | __copyright__ = 'Copyright 2015, DHONT René-Luc / 3Liz' 14 | 15 | import unittest 16 | 17 | from PyQt4.QtGui import QDialogButtonBox, QDialog 18 | 19 | from wps4server_dialog import wps4serverDialog 20 | 21 | from utilities import get_qgis_app 22 | QGIS_APP = get_qgis_app() 23 | 24 | 25 | class wps4serverDialogTest(unittest.TestCase): 26 | """Test dialog works.""" 27 | 28 | def setUp(self): 29 | """Runs before each test.""" 30 | self.dialog = wps4serverDialog(None) 31 | 32 | def tearDown(self): 33 | """Runs after each test.""" 34 | self.dialog = None 35 | 36 | def test_dialog_ok(self): 37 | """Test we can click OK.""" 38 | 39 | button = self.dialog.button_box.button(QDialogButtonBox.Ok) 40 | button.click() 41 | result = self.dialog.result() 42 | self.assertEqual(result, QDialog.Accepted) 43 | 44 | def test_dialog_cancel(self): 45 | """Test we can click cancel.""" 46 | button = self.dialog.button_box.button(QDialogButtonBox.Cancel) 47 | button.click() 48 | result = self.dialog.result() 49 | self.assertEqual(result, QDialog.Rejected) 50 | 51 | if __name__ == "__main__": 52 | suite = unittest.makeSuite(wps4serverDialogTest) 53 | runner = unittest.TextTestRunner(verbosity=2) 54 | runner.run(suite) 55 | 56 | -------------------------------------------------------------------------------- /test/utilities.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Common functionality used by regression tests.""" 3 | 4 | import sys 5 | import logging 6 | 7 | 8 | LOGGER = logging.getLogger('QGIS') 9 | QGIS_APP = None # Static variable used to hold hand to running QGIS app 10 | CANVAS = None 11 | PARENT = None 12 | IFACE = None 13 | 14 | 15 | def get_qgis_app(): 16 | """ Start one QGIS application to test against. 17 | 18 | :returns: Handle to QGIS app, canvas, iface and parent. If there are any 19 | errors the tuple members will be returned as None. 20 | :rtype: (QgsApplication, CANVAS, IFACE, PARENT) 21 | 22 | If QGIS is already running the handle to that app will be returned. 23 | """ 24 | 25 | try: 26 | from PyQt4 import QtGui, QtCore 27 | from qgis.core import QgsApplication 28 | from qgis.gui import QgsMapCanvas 29 | from qgis_interface import QgisInterface 30 | except ImportError: 31 | return None, None, None, None 32 | 33 | global QGIS_APP # pylint: disable=W0603 34 | 35 | if QGIS_APP is None: 36 | gui_flag = True # All test will run qgis in gui mode 37 | #noinspection PyPep8Naming 38 | QGIS_APP = QgsApplication(sys.argv, gui_flag) 39 | # Make sure QGIS_PREFIX_PATH is set in your env if needed! 40 | QGIS_APP.initQgis() 41 | s = QGIS_APP.showSettings() 42 | LOGGER.debug(s) 43 | 44 | global PARENT # pylint: disable=W0603 45 | if PARENT is None: 46 | #noinspection PyPep8Naming 47 | PARENT = QtGui.QWidget() 48 | 49 | global CANVAS # pylint: disable=W0603 50 | if CANVAS is None: 51 | #noinspection PyPep8Naming 52 | CANVAS = QgsMapCanvas(PARENT) 53 | CANVAS.resize(QtCore.QSize(400, 400)) 54 | 55 | global IFACE # pylint: disable=W0603 56 | if IFACE is None: 57 | # QgisInterface is a stub implementation of the QGIS plugin interface 58 | #noinspection PyPep8Naming 59 | IFACE = QgisInterface(CANVAS) 60 | 61 | return QGIS_APP, CANVAS, IFACE, PARENT 62 | -------------------------------------------------------------------------------- /wps4serverServer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | /*************************************************************************** 4 | wps4server: A QGIS Server plugin to add OGC Web Processing Service 5 | capabilities 6 | --------------------- 7 | Date : August 2015 8 | copyright : (C) 2015 by DHONT René-Luc - 3Liz 9 | email : rldhont@3liz.com 10 | ***************************************************************************/ 11 | 12 | /*************************************************************************** 13 | * * 14 | * This program is free software; you can redistribute it and/or modify * 15 | * it under the terms of the GNU General Public License as published by * 16 | * the Free Software Foundation; either version 2 of the License, or * 17 | * (at your option) any later version. * 18 | * * 19 | ***************************************************************************/ 20 | """ 21 | 22 | __author__ = 'DHONT René-Luc' 23 | __date__ = 'August 2015' 24 | __copyright__ = '(C) 2015, DHONT René-Luc - 3Liz' 25 | 26 | from PyQt4.QtCore import * 27 | from PyQt4.QtGui import * 28 | from qgis.core import * 29 | from qgis.server import * 30 | 31 | import os.path 32 | 33 | class wps4serverServer: 34 | """Plugin for QGIS server 35 | this plugin loads wps filter based on PyWPS""" 36 | 37 | def __init__(self, serverIface): 38 | # Save reference to the QGIS server interface 39 | self.serverIface = serverIface 40 | QgsMessageLog.logMessage("SUCCESS - wps4server init", 'plugin', QgsMessageLog.INFO) 41 | 42 | from filters.wpsFilter import wpsFilter 43 | try: 44 | serverIface.registerFilter( wpsFilter(serverIface), 100 ) 45 | except Exception, e: 46 | QgsLogger.debug("wps4server - Error loading filter wps : %s" % e ) 47 | 48 | -------------------------------------------------------------------------------- /wps4server_dialog.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | /*************************************************************************** 4 | wps4serverDialog 5 | A QGIS plugin 6 | OGC Web Processing Service for QGIS Server 7 | ------------------- 8 | begin : 2015-08-26 9 | git sha : $Format:%H$ 10 | copyright : (C) 2015 by DHONT René-Luc / 3Liz 11 | email : rldhont@3liz.com 12 | ***************************************************************************/ 13 | 14 | /*************************************************************************** 15 | * * 16 | * This program is free software; you can redistribute it and/or modify * 17 | * it under the terms of the GNU General Public License as published by * 18 | * the Free Software Foundation; either version 2 of the License, or * 19 | * (at your option) any later version. * 20 | * * 21 | ***************************************************************************/ 22 | """ 23 | 24 | import os 25 | 26 | from PyQt4 import QtGui, uic 27 | 28 | FORM_CLASS, _ = uic.loadUiType(os.path.join( 29 | os.path.dirname(__file__), 'wps4server_dialog_base.ui')) 30 | 31 | 32 | class wps4serverDialog(QtGui.QDialog, FORM_CLASS): 33 | def __init__(self, parent=None): 34 | """Constructor.""" 35 | super(wps4serverDialog, self).__init__(parent) 36 | # Set up the user interface from Designer. 37 | # After setupUI you can access any designer object by doing 38 | # self., and you can use autoconnect slots - see 39 | # http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html 40 | # #widgets-and-dialogs-with-auto-connect 41 | self.setupUi(self) 42 | --------------------------------------------------------------------------------