Package for creating (Py)WPS Process classes
pywps.Process.
Status
¶Status object for each process
creationTime
¶time.time()
code
¶“processstarted”, “processfailed” or anything else
percentCompleted
¶how far the calculation is
value
¶message string to the client
onStatusChanged
()¶Redefine this method in your functions
set
(msg='', percentDone=0, propagate=True)¶Set status message
Parameters: |
|
---|
setProcessStatus
(code, value)¶Sets current status of the process. Calls onStatusChanged method
Parameters: |
|
---|
pywps.Process.
WPSProcess
(identifier, title=None, abstract=None, metadata=[], profile=[], version='None', statusSupported=True, storeSupported=False, grassLocation=None, logFile=<open file '<stderr>', mode 'w'>)¶Base class for any PyWPS Process
Parameters: |
|
---|
identifier
¶Process identifier
version
¶Process version
metadata
¶List of references to metadata resources
title
¶Process title
abstract
¶Process abstract
wsdl
¶Not implemented
profile
¶Process profile
storeSupported
¶Indicates, whether the process supports storing of it’s results for later usage
statusSupported
¶Indicates, whether assynchronous running of the process is possible
debug
¶Print some information to log file
inputs
¶List of process inputs, pywps.Process.InAndOutputs.Input
outputs
¶List of process outputs, pywps.Process.InAndOutputs.Output
lang
¶instance of pywps.Process.Lang.Lang
class
grassLocation
¶Indicates, if and how GRASS GIS should be used
Temporary GRASS location is created. It is in XY reference coordinate system
Note
In the future, location should have the same coordinate system, as the input dataset is.
logFile
¶File object, where to print log in.
pywps
¶copy of the pywps.Pywps
instance
addBBoxInput
(identifier, title, abstract=None, metadata=[], minOccurs=1, maxOccurs=1, crss=['EPSG:4326'])¶Add BoundingBox input
Parameters: |
|
---|---|
Returns: |
addBBoxOutput
(identifier, title, abstract=None, crs='EPSG:4326', dimensions=2, asReference=False)¶Add new output item of type BoundingBoxValue to this process
Parameters: |
|
---|---|
Returns: |
addComplexInput
(identifier, title, abstract=None, metadata=[], minOccurs=1, maxOccurs=1, formats=[{'mimeType': None}], maxmegabites=None)¶Add complex input to this process
Parameters: |
|
---|---|
Returns: |
addComplexOutput
(identifier, title, abstract=None, metadata=[], formats=[{'mimeType': None}], useMapscript=False, asReference=False)¶Add complex output to this process
Parameters: |
|
---|---|
Returns: |
addLiteralInput
(identifier, title, abstract=None, uoms=(), minOccurs=1, maxOccurs=1, allowedValues='*', type=<type 'int'>, default=None, metadata=[])¶Add new input item of type LiteralValue to this process
Parameters: |
|
---|---|
Returns: |
addLiteralOutput
(identifier, title, abstract=None, metadata=[], uoms=(), type=<type 'int'>, default=None, asReference=False)¶Add new output item of type LiteralValue to this process
Parameters: |
|
---|---|
Returns: |
cmd
(cmd, stdin=None, stdout=True)¶Command line commands (including GRASS modules)
Note
This module is supposed to be used instead of ‘os.system()’, while running GRASS modules
Parameters: |
|
---|---|
Return type: | string |
Returns: | standard ouput from the command |
Example Usage:
self.cmd(["r.los","in=elevation.dem","out=los","coord=1000,1000"])
self.cmd(["v.net.path","network","afcol=forward","abcol=backward",
"out=mypath",'''nlayer=1","1 9 12"'''])
self.cmd(["d.mon","start=PNG"],stdout=False)
execute
()¶This method will be called by pywps.Wps.Execute.Execute
. Please
redefine this in your process instance
Returns: | None if succeeded, error message otherwise. |
---|
getInput
(identifier)¶Get input defined by identifier
Parameters: | identifier – input identifier |
---|---|
Returns: | pywps.Process.InAndOutputs.Input |
getInputValue
(identifier)¶Get input value according to identifier
Parameters: | identifier – input identifier |
---|---|
Returns: | None or self.inputs[identifier].value |
getInputValues
(identifier)¶Get input values according to identifier :param identifier: input identifier :return: a list of input values
i18n
(key)¶Give back translation of defined key
Parameters: | key – key value to be translated |
---|---|
Returns: | translated string |
initProcess
(title=None, abstract=None, metadata=[], profile=[], version=None, statusSupported=True, storeSupported=False, grassLocation=None)¶Can be used for later process re-initialization
For parameters, see constructor WPSProcess
parameters.
message
(msg, force=False)¶Print some message to logfile
Parameters: |
|
---|
setOutputValue
(identifier, value)¶Set output value
Parameters: |
|
---|