In [1]:
# WPS endpoints:
wps_emu = "http://localhost:8094/wps"
wps_flyingpigeon = "http://localhost:8092/wps"
wps_hummingbird = "http://localhost:8092/wps"
wps_phoenix = "http://localhost:8091/wps"
In [2]:
# wps services are registered in csw catalog:
phoenix_csw = 'http://localhost:8082/csw'
In [2]:
from owslib.wps import WebProcessingService, monitorExecution
wps = WebProcessingService(url="http://localhost:8094/wps", verbose=False)
In [3]:
from owslib.wps import WebProcessingService
wps = WebProcessingService(url=wps_emu,verbose=True)
print wps
owslib.ows.ServiceIdentification : {'accessconstraints': 'None', 'service': 'WPS', 'title': 'Emu', '_root': <Element {http://www.opengis.net/ows/1.1}ServiceIdentification at 0x7f32c4a5a290>, 'profiles': [], 'version': '1.0.0', 'fees': 'None', 'keywords': ['WPS', 'PyWPS', 'Birdhouse', 'emu'], 'type': 'WPS', 'abstract': 'WPS processes for testing and demos.'}
owslib.ows.ServiceProvider : {'url': 'http://emu.readthedocs.org/en/latest/', '_root': <Element {http://www.opengis.net/ows/1.1}ServiceProvider at 0x7f32c4a5a368>, 'contact': <owslib.ows.ServiceContact object at 0x7f32bc24e810>, 'name': 'Birdhouse/Emu'}
owslib.ows.OperationsMetadata : {'formatOptions': ['text/xml'], 'constraints': [], 'name': 'GetCapabilities', 'parameters': {}, 'methods': [{'url': 'http://localhost:8094/wps?', 'type': 'Get', 'constraints': []}, {'url': 'http://localhost:8094/wps', 'type': 'Post', 'constraints': []}]}
owslib.ows.OperationsMetadata : {'formatOptions': ['text/xml'], 'constraints': [], 'name': 'DescribeProcess', 'parameters': {}, 'methods': [{'url': 'http://localhost:8094/wps?', 'type': 'Get', 'constraints': []}, {'url': 'http://localhost:8094/wps', 'type': 'Post', 'constraints': []}]}
owslib.ows.OperationsMetadata : {'formatOptions': ['text/xml'], 'constraints': [], 'name': 'Execute', 'parameters': {}, 'methods': [{'url': 'http://localhost:8094/wps?', 'type': 'Get', 'constraints': []}, {'url': 'http://localhost:8094/wps', 'type': 'Post', 'constraints': []}]}
owslib.wps.Process : {'identifier': 'helloworld', 'verbose': True, 'title': 'Hello World', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5acb0>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Welcome user and say hello ...'}
owslib.wps.Process : {'identifier': 'helloworld', 'verbose': True, 'title': 'Hello World', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5acb0>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Welcome user and say hello ...'}
owslib.wps.Process : {'identifier': 'ultimatequestionprocess', 'verbose': True, 'title': 'Answer to Life, the Universe and Everything', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5ac20>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '2.0', '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.'}
owslib.wps.Process : {'identifier': 'ultimatequestionprocess', 'verbose': True, 'title': 'Answer to Life, the Universe and Everything', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5ac20>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '2.0', '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.'}
owslib.wps.Process : {'identifier': 'dummyprocess', 'verbose': True, 'title': 'Dummy Process', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5a950>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '0.1', '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'}
owslib.wps.Process : {'identifier': 'dummyprocess', 'verbose': True, 'title': 'Dummy Process', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5a950>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '0.1', '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'}
owslib.wps.Process : {'identifier': 'wordcount', 'verbose': True, 'title': 'Word Counter', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5aab8>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Counts words in a given text ...'}
owslib.wps.Process : {'identifier': 'wordcount', 'verbose': True, 'title': 'Word Counter', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5aab8>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Counts words in a given text ...'}
owslib.wps.Process : {'identifier': 'inout', 'verbose': True, 'title': 'Testing all Data Types', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5acf8>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '0.2', 'abstract': 'Just testing data types like date, datetime etc ...'}
owslib.wps.Process : {'identifier': 'inout', 'verbose': True, 'title': 'Testing all Data Types', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5acf8>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '0.2', 'abstract': 'Just testing data types like date, datetime etc ...'}
owslib.wps.Process : {'identifier': 'multiplesources', 'verbose': True, 'title': 'Multiple Sources', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5ad40>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Process with multiple different sources ...'}
owslib.wps.Process : {'identifier': 'multiplesources', 'verbose': True, 'title': 'Multiple Sources', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5ad40>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Process with multiple different sources ...'}
owslib.wps.Process : {'identifier': 'chomsky', 'verbose': True, 'title': 'Chomsky text generator', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5ad88>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Generates a random chomsky text ...'}
owslib.wps.Process : {'identifier': 'chomsky', 'verbose': True, 'title': 'Chomsky text generator', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5ad88>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '1.0', 'abstract': 'Generates a random chomsky text ...'}
owslib.wps.Process : {'identifier': 'zonal_mean', 'verbose': True, 'title': 'Zonal Mean', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5add0>, 'statusSupported': False, 'storeSupported': False, 'processVersion': '0.2', 'abstract': 'zonal mean in NetCDF File.'}
owslib.wps.Process : {'identifier': 'zonal_mean', 'verbose': True, 'title': 'Zonal Mean', '_root': <Element {http://www.opengis.net/wps/1.0.0}Process at 0x7f32c4a5add0>, 'processOutputs': [], 'dataInputs': [], 'statusSupported': False, 'storeSupported': False, 'processVersion': '0.2', 'abstract': 'zonal mean in NetCDF File.'}
<owslib.wps.WebProcessingService object at 0x7f32c4a4fcd0>
In [4]:
print wps.identification.title
Emu
In [5]:
for operation in wps.operations:
print operation.name
GetCapabilities
DescribeProcess
Execute
In [6]:
for process in wps.processes:
print process.identifier, process.title
helloworld Hello World
ultimatequestionprocess Answer to Life, the Universe and Everything
dummyprocess Dummy Process
wordcount Word Counter
inout Testing all Data Types
multiplesources Multiple Sources
chomsky Chomsky text generator
zonal_mean Zonal Mean
In [9]:
### how to invoke the processes:
In [7]:
from owslib.wps import printInputOutput
process = wps.describeprocess('zonal_mean')
print process.identifier
print process.title
print process.abstract
owslib.wps.Process : {'identifier': 'zonal_mean', 'verbose': True, 'title': 'Zonal Mean', '_root': <Element ProcessDescription at 0x7f32c4a5a758>, 'statusSupported': True, 'storeSupported': True, 'processVersion': None, 'abstract': 'zonal mean in NetCDF File.'}
Input: owslib.wps.Input : {'minOccurs': 1, 'title': 'NetCDF File', 'dataType': 'ComplexData', 'abstract': 'NetCDF File', 'supportedValues': [<owslib.wps.ComplexData object at 0x7f32bc24e350>], 'allowedValues': [], 'maxOccurs': 100, 'anyValue': False, 'identifier': 'netcdf_file', 'defaultValue': <owslib.wps.ComplexData object at 0x7f32bc24ee90>}
Output: owslib.wps.Output : {'mimeType': None, 'reference': None, 'title': 'Output', 'dataType': 'ComplexData', 'abstract': 'Output', 'supportedValues': [<owslib.wps.ComplexData object at 0x7f32c4a58490>], 'filePath': None, 'allowedValues': [], 'anyValue': False, 'fileName': None, 'identifier': 'output', 'data': [], 'defaultValue': <owslib.wps.ComplexData object at 0x7f32c4a4f390>}
zonal_mean
Zonal Mean
zonal mean in NetCDF File.
In [8]:
for inputval in process.dataInputs:
printInputOutput(inputval)
identifier=netcdf_file, title=NetCDF File, abstract=NetCDF File, data type=ComplexData
Supported Value: mimeType=application/x-netcdf, encoding=None, schema=None
Default Value: mimeType=application/x-netcdf, encoding=None, schema=None
minOccurs=1, maxOccurs=100
In [ ]:
Content source: stephank16/test
Similar notebooks: