Representation of a WPS process. Usually instances of OpenLayers.WPSProcess are created by calling ‘getProcess’ on an OpenLayers.WPSClient instance.
Currently OpenLayers.WPSProcess supports processes that have geometries or features as output, using WKT or GeoJSON as output format. It also supports chaining of processes by using the output method to create a handle that is used as process input instead of a static value.
OpenLayers. | Representation of a WPS process. |
Properties | |
client | {OpenLayers.WPSClient} The client that manages this process. |
server | {String} Local client identifier for this process’s server. |
identifier | {String} Process identifier known to the server. |
description | {Object} DescribeProcess response for this process. |
localWPS | {String} Service endpoint for locally chained WPS processes. |
formats | {Object} OpenLayers.Format instances keyed by mimetype. |
chained | {Integer} Number of chained processes for pending execute requests that don’t have a full configuration yet. |
executeCallbacks | {Array} Callbacks waiting to be executed until all chained processes are configured; |
Constructor | |
OpenLayers. | |
Functions | |
describe | Makes the client issue a DescribeProcess request asynchronously. |
configure | Configure the process, but do not execute it. |
execute | Configures and executes the process |
output | Chain an output of a configured process (see configure) as input to another process. |
parseDescription | Parses the DescribeProcess response |
setInputData | Sets the data for a single input |
setResponseForm | Sets the responseForm property of the execute payload. |
getOutputIndex | Gets the index of a processOutput by its identifier |
chainProcess | Sets a fully configured chained process as input for this process. |
toFeatures | Converts spatial input into features so it can be processed by OpenLayers.Format instances. |
findMimeType | Finds a supported mime type. |
OpenLayers. | Type for chaining processes. |
Properties | |
process | {OpenLayers.WPSProcess} The process to chain |
output | {String} The output identifier of the output we are going to use as input for another process. |
Constructor | |
OpenLayers. |
{OpenLayers.WPSClient} The client that manages this process.
{String} Service endpoint for locally chained WPS processes. Default is ‘http://geoserver/wps’.
options | {Object} Object whose properties will be set on the instance. |
client | {OpenLayers.WPSClient} Mandatory. Client that manages this process. |
server | {String} Mandatory. Local client identifier of this process’s server. |
identifier | {String} Mandatory. Process identifier known to the server. |
describe: function( options )
Makes the client issue a DescribeProcess request asynchronously.
options | {Object} Configuration for the method call |
callback | {Function} Callback to execute when the description is available. Will be called with the parsed description as argument. Optional. |
scope | {Object} The scope in which the callback will be executed. Default is the global object. |
configure: function( options )
Configure the process, but do not execute it. Use this for processes that are chained as input of a different process by means of the output method.
options | {Object} |
{OpenLayers.WPSProcess} this process.
inputs | {Object} The inputs for the process, keyed by input identifier. For spatial data inputs, the value of an input is usually an OpenLayers.Geometry, an OpenLayers.Feature.Vector or an array of geometries or features. |
callback | {Function} Callback to call when the configuration is complete. Optional. |
scope | {Object} Optional scope for the callback. |
execute: function( options )
Configures and executes the process
options | {Object} |
inputs | {Object} The inputs for the process, keyed by input identifier. For spatial data inputs, the value of an input is usually an OpenLayers.Geometry, an OpenLayers.Feature.Vector or an array of geometries or features. |
output | {String} The identifier of the output to request and parse. Optional. If not provided, the first output will be requested. |
success | {Function} Callback to call when the process is complete. This function is called with an outputs object as argument, which will have a property with the identifier of the requested output (or ‘result’ if output was not configured). For processes that generate spatial output, the value will be an array of OpenLayers.Feature.Vector instances. |
scope | {Object} Optional scope for the success callback. |
output: function( identifier )
Chain an output of a configured process (see configure) as input to another process.
intersect = client.getProcess('opengeo', 'JTS:intersection'); intersect.configure({ // ... }); buffer = client.getProcess('opengeo', 'JTS:buffer'); buffer.execute({ inputs: { geom: intersect.output('result'), // <-- here we're chaining distance: 1 }, // ... });
identifier | {String} Identifier of the output that we’re chaining. If not provided, the first output will be used. |
setInputData: function( input, data )
Sets the data for a single input
input | {Object} An entry from the dataInputs array of the process description. |
data | {Mixed} For spatial data inputs, this is usually an OpenLayers.Geometry, an OpenLayers.Feature.Vector or an array of geometries or features. |
setResponseForm: function( options )
Sets the responseForm property of the execute payload.
options | {Object} See below. |
outputIndex | {Integer} The index of the output to use. Optional. |
supportedFormats | {Object} Object with supported mime types as key, and true as value for supported types. Optional. |
getOutputIndex: function( outputs, identifier )
Gets the index of a processOutput by its identifier
outputs | {Array} The processOutputs array to look at |
identifier | {String} The identifier of the output |
Returns {Integer} The index of the processOutput with the provided identifier in the outputs array.
chainProcess: function( input, chainLink )
Sets a fully configured chained process as input for this process.
input | {Object} The dataInput that the chained process provides. |
chainLink | {OpenLayers.WPSProcess.ChainLink} The process to chain. |
toFeatures: function( source )
Converts spatial input into features so it can be processed by OpenLayers.Format instances.
source | {Mixed} An OpenLayers.Geometry, an OpenLayers.Feature.Vector, or an array of geometries or features |
{Array(OpenLayers.Feature.Vector)}
findMimeType: function( sourceFormats, targetFormats )
Finds a supported mime type.
sourceFormats | {Object} An object literal with mime types as key and true as value for supported formats. |
targetFormats | {Object} Like <sourceFormats>, but optional to check for supported mime types on a different target than this process. Default is to check against this process’s supported formats. |
{String} A supported mime type.
Type for chaining processes.
Properties | |
process | {OpenLayers.WPSProcess} The process to chain |
output | {String} The output identifier of the output we are going to use as input for another process. |
Constructor | |
OpenLayers. |
{OpenLayers.WPSProcess} The process to chain
Makes the client issue a DescribeProcess request asynchronously.
describe: function( options )
Configure the process, but do not execute it.
configure: function( options )
Configures and executes the process
execute: function( options )
Chain an output of a configured process (see configure) as input to another process.
output: function( identifier )
Parses the DescribeProcess response
parseDescription: function( description )
Sets the data for a single input
setInputData: function( input, data )
Sets the responseForm property of the execute payload.
setResponseForm: function( options )
Gets the index of a processOutput by its identifier
getOutputIndex: function( outputs, identifier )
Sets a fully configured chained process as input for this process.
chainProcess: function( input, chainLink )
Converts spatial input into features so it can be processed by OpenLayers.Format instances.
toFeatures: function( source )
Finds a supported mime type.
findMimeType: function( sourceFormats, targetFormats )