Inputs and outputs of OGC WPS Processes
pywps.Process.InAndOutputs.
Input
(identifier, title, abstract=None, metadata=[], minOccurs=1, maxOccurs=1, type=None)¶Class WPS Input
Parameters: |
|
---|
identifier
¶input identifier
title
¶input title
abstract
¶input abstract
metadata
¶input metadata reference
minOccurs
¶minimum occurense
maxOccurs
¶maximum occurense
type
¶type, one of “LiteralValue”, “ComplexValue”, “BoundingBoxValue”
value
¶actual value of this input
ms
¶magic
cookie
getValue
(idx=0)¶Get this value
setValue
(input)¶Control in some way the input value from the client
Parameters: | input – input value, parsed in pywps.Parser.Execute |
---|
pywps.Process.InAndOutputs.
LiteralInput
(identifier, title, abstract=None, metadata=[], minOccurs=1, maxOccurs=1, dataType=<type 'str'>, uoms=(), values='*', spacing=None, default=None)¶Literal input type of input.
Parameters: |
|
---|
dataType
¶types.TypeType
type of literal data. Default is integer
uoms
¶list of units
values
¶allowed values
default
¶default value
spacing
¶Note
this attribute is not used
uom
¶units
getValue
()¶Get the input value
Returns: | value |
---|
setValue
(input)¶Set input value to this input
Parameters: | input – input parsed by parsers |
---|---|
Returns: | None or Error message |
pywps.Process.InAndOutputs.
ComplexInput
(identifier, title, abstract=None, metadata=[], minOccurs=1, maxOccurs=1, maxmegabites=None, formats=[{'mimeType': None}])¶ComplexInput type
Parameters: |
|
---|
maxFileSize
¶maximal allowed file size
formats
¶list of supported formats
format
¶the final format
value
¶file name with the complex data
checkMimeTypeIn
(fileName)¶Check, if the given mimetype is in self.formats checkMimeType is done after process.format is set by parsing user’s content. 1) if process.format[mimetype] has content it will be check in formats 2) if process.format[mimetype]–>None assume process.format as first in list
- no exceptions should be risen
4) As request by wps-grass-process, in case of missing information even schema is passed. This is necessary for vector processes and to differenciate between text/xml from GML and KML :param fileName: :param mimeType:
downloadData
(url)¶Download data from given url. Do not download more, then
maxFileSize
Parameters: | url – URL where the data are lying |
---|
downloadData2
(url)¶Download data from given file url.
Parameters: | url – File URL where the data are lying |
---|
getValue
(asFile=False)¶Get this value
Parameters: | asFile – return the value not as file name (default), but as file object |
---|---|
Returns: | value |
Return type: | string or file |
onMaxFileSizeExceeded
(what)¶Empty method, called, when there was any problem with the input.
Parameters: | what – Error code |
---|
onNotFound
(what)¶Empty method, called, when there was any problem with the input.
Parameters: | what – Error code |
---|
onProblem
(what, why)¶Empty method, called, when there was any problem with the input. This method is replaced in Execute.consolidateInputs, basically input.onProblem = self.onInputProblem therefore Exception raise is implemented in Execute.onInputProblem() :param what: Message with error description :param why: Error code
setMimeType
(input)¶Sets the MimeType from input before going to setValue() this allows for some self.format to be filled febore base64 decoding. URL inputs don’t have an input[], since they are just URLs. There mimeType was implemented to URL references, basically it sets a self.format based on the input provided by the user e.g:http://localhost/wps.cgi?request=Execute&service=wps&version=1.0.0&identifier=geotiff2png&datainputs=[input=@xlink:href=http://rsg.pml.ac.uk/wps/testdata/elev_srtm_30m.tif@method=POST@mimeType=text%2Fxml] this example shall raise an exception
setValue
(input)¶Set input value for this input
Parameters: | input – parsed input value |
---|
storeData
(data)¶Store data from given file. Not bigger, then
maxFileSize
Parameters: | data (string) – the data, which should be stored |
---|
pywps.Process.InAndOutputs.
BoundingBoxInput
(identifier, title, abstract=None, metadata=[], minOccurs=1, maxOccurs=1, dimensions=None, crss=[])¶Add BoundingBox input
Parameters: |
|
---|
crss
¶Supported coordinate systems
dimensions
¶Bbox dimensions
crs
¶Used coordinate system
coords
¶List of list of coordinates in form:
(
(minx,miny [, minz, [...] ] ),
(maxx,maxy [, minz, [...] ])
[, (maxx,maxy [, maxz, [...] ]),
[, ...]
]
)
So, most common case:
((minx,miny),(maxx, maxy))
getValue
()¶Get this value
Returns: | bounding box in format:(minx, miny, maxx, maxy)
|
---|
setValue
(input)¶Set value of this input
Parameters: | input – bounding box parsed input in format: {identifier:"id",dimensions:2, value:(minx,miny,maxx,maxy),
crs:"epsg4326"}
or similar |
---|
pywps.Process.InAndOutputs.
Output
(identifier, title, abstract=None, metadata=[], type=None, asReference=False)¶Class WPS Input
Parameters: |
|
---|
identifier
¶title
¶abstract
¶metadata
¶type
¶“ComplexValue”, “LiteralValue”, “BoundingBoxValue”
asReference
¶this output should be formated as reference (URL) or give the file content back
value
¶output value
ms
¶mime cookie
setValue
(value)¶Set this output value
pywps.Process.InAndOutputs.
LiteralOutput
(identifier, title, abstract=None, metadata=[], uoms=(), dataType=<type 'str'>, default=None, asReference=False)¶Literal output class
Parameters: |
|
---|
pywps.Process.InAndOutputs.
ComplexOutput
(identifier, title, abstract=None, metadata=[], formats=[{'mimeType': None}], asReference=False, projection=None, bbox=None, useMapscript=False)¶Complex value output
Parameters: |
|
---|
formats
¶list of supported formats.:
[
{
'mimeType':'text/xml',
'encoding':'utf-8',
'schema':'http://schemas.opengis.net/gml/3.2.1/gml.xsd'
},
{
....
}
]
format
¶file format of the input file
projection
¶file projection (used by mapserver, see useMapscript below), is not set, will be determined automatically
bbox
¶data bounding box (used by mapserver, see useMapscript below) if not set, will be determined automatically
width
¶(used by mapserver, see useMapscript below) if not set, will be determined automatically
height
¶(used by mapserver, see useMapscript below) if not set, will be determined automatically
useMapscript
¶If set to true and asReference is set to true (by request), PyWPS will gerenate UMN MapServer mapfile and point the reference URL to it, so that raster layer will be accessible as OGC WCS and vector layer will be accessible as OGC WFS. This enables the client more flexible bindings of resulting ouput files.
Attributes projection, bbox, width and height will be used. If not set, they will be determined using gdal/ogr libraries. If something does not work, try to adjust them manualy.
Unlike ComplexInput, the check for mimeType is done in Execute during output consolidation.
onProblem
(what, why)¶Empty method, called, when there was any problem with the input. This method is replaced in Execute.consolidateInputs, basically output.onProblem = self.onOutputProblem therefore Exception raise is implemented in Execute.onInputProblem() :param what: Message with error description :param why: Error code
setValue
(value)¶Set the output value
Parameters: | value (string or file) – value to be returned (file name or file itself) |
---|
pywps.Process.InAndOutputs.
BoundingBoxOutput
(identifier, title, abstract=None, metadata=[], crss=[], dimensions=None, asReference=False)¶Bounding box ouput
Parameters: |
|
---|
crss
¶list of supporte coordinate systems
crs
¶coordinate system
dimensions
¶bbox dimensions
coords
¶setValue
(value)¶Set value to bbox output
Parameters: | value – boundngbox: (minx,miny,maxx,maxy)
|
---|