Aufruf

Man hat 3 Möglichkeiten, wie man PyWPS aufruft:

  1. Konsole
    $ export PYWPS_CFG=/home/fossgis/fossgis/fossgiswps.cfg
    $ export PYWPS_PROCESSES=/home/fossgis/fossgis/prozesses/
    
    $ wps.py "service=wps&request=getcapabilities"

    Man sieht direkt was los ist, sowohl auf STDOUT als auch auf STDERR

  2. wget:

    $ wget -O - "http://localhost/cgi-bin/fossgiswps?service=wps&request=getcapabilities"
  3. Im Webbrowser (mit dem FOSSGIS-Life CD benutzt Firefox)

    http://localhost/cgi-bin/fossgiswps?service=wps&request=getcapabilities

Immer ist es gut tail -f /var/log/apache/error.log nebenbei zu laufen.

GetCapabilities

HTTP GET

Entweder:

$ export PYWPS_CFG=/home/fossgis/fossgis/fossgiswps.cfg
$ export PYWPS_PROCESSES=/home/fossgis/fossgis/prozesses/

$ wps.py "service=wps&request=getcapabilities"

Oder

http://localhost/cgi-bin/fossgiswps?service=wps&request=getcapabilities

Parametern

service
WPS
request
GetCapabilities

HTTP POST

1
2
3
4
5
$ export PYWPS_CFG=/home/fossgis/fossgis/fossgiswps.cfg
$ export PYWPS_PROCESSES=/home/fossgis/fossgis/prozesses/
$ export REQUEST_METHOD=POST

$ cat pywps/doc/examples/wps_getcapabilities_request.xml | wps.py

XML Encoding

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="UTF-8"?>
<!-- WPS GetCapabilities request-->
<!-- Equivalent GET request is http://foo.bar/foo?Service=WPS&Version=1.0.0&Request=GetCapabilities&Language=en-CA -->
<ows:GetCapabilities xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 ..\wpsGetCapabilities_request.xsd" language="en-CA" service="WPS">
    <ows:AcceptVersions>
        <ows:Version>1.0.0</ows:Version>
    </ows:AcceptVersions>
</ows:GetCapabilities>

DescribeProcess

HTTP GET

http://localhost/cgi-bin/fossgiswps?service=wps&request=describeprocess&version=1.0.0&identifier=exampleBufferProcess,ultimatequestionprocess

service
WPS
request
DescribeProcess
version
1.0.0
identifier
exampleBufferProcess[,ultimatequestionprocess]

HTTP POST

XML Datei (pywps/doc/examples/wps_describeprocess_request.xml):

1
2
3
4
5
<?xml version="1.0" encoding="UTF-8"?>
<DescribeProcess xmlns="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ..\wpsDescribeProcess_request.xsd" service="WPS" version="1.0.0" language="en-CA">
        <ows:Identifier>exampleBufferProcess</ows:Identifier>
        <ows:Identifier>ultimatequestionprocess</ows:Identifier>
</DescribeProcess>

Execute

HTTP GET

exampleBufferProcess:
http://localhost/cgi-bin/fossgiswps?service=wps&request=execute&version=1.0.0&identifier=exampleBufferProcess&datainputs=[data=@href=http://les-ejk.cz/schulung/pywps-de/_images/line.xml;width=2]&storeExecuteResponse=true&status=false
ultimatequestionprocess:
http://localhost/cgi-bin/fossgiswps?service=wps&request=execute&version=1.0.0&identifier=ultimatequestionprocess&storeExecuteResponse=true&status=true
service
WPS
request
Execute
version
1.0.0
identifier
exampleBufferProcess
datainputs
[data=@href=http://les-ejk.cz/schulung/pywps-de/_images/line.xml;width=2]
status
false
storeExecuteResponse
true

HTTP POST

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<wps:Execute service="WPS" version="1.0.0" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0/wpsExecute_request.xsd">
    <ows:Identifier>exampleBufferProcess</ows:Identifier>
    <wps:DataInputs>
        <wps:Input>
            <ows:Identifier>data</ows:Identifier>
            <wps:Reference xlink:href="http://les-ejk.cz/schulung/pywps-de/_images/line.xml"/>
        </wps:Input>
        <wps:Input>
            <ows:Identifier>width</ows:Identifier>
            <wps:Data>
                <wps:LiteralData>2</wps:LiteralData>
            </wps:Data>
        </wps:Input>
    </wps:DataInputs>
    <wps:ResponseForm>
        <wps:ResponseDocument wps:lineage="false" wps:storeExecuteResponse="true" wps:status="false">
            <wps:Output wps:asReference="false">
                <ows:Identifier>buffer</ows:Identifier>
            </wps:Output>
        </wps:ResponseDocument>
    </wps:ResponseForm>
</wps:Execute>
_images/line.xml