[ZOO-Discuss] GRASS WPS Process Description

Soeren Gebbert soerengebbert at googlemail.com
Fri Nov 27 16:12:40 PST 2009


Hello Gerald,
thanks for your post. It is really important for me that a WPS expert
has a look on the generated XML documents.
I am still a bloody beginner at this topic.

The XML output of grass should be WPS 1.0.0 compatible.
I am using the OGC WPS 1.0.0 xsd files for validation and the WPS
1.0.0 OGC report number 05-007r07.

2009/11/28 Gérald Fenoy <gerald.fenoy at geolabs.fr>:
> Hi Markus,
> nice to hear from you again.
> There is something in the DescribeProcess which make me wondering if I'm
> wrong or miss something (or maybe the last version of WPS proposal ??). Why
> was ComplexOutput used where ComplexData should be used ?
> Table 46 of the WPS proposal define the Data structure and seems to define
> that we have to use ComplexData rather than ComplexOutput.

ComplexData is used within Input description and ComplexOutput is used
in Output description.
The XML file within the mail of Markus is only a part of a more
complex XML file.
The last ComplexOutput is part of an Output description. Well,
ComplexOutput is indeed of data type ComplexData (see table 36) but
you have to name it ComplexOutput in case of an Output.

But besides of that, there are several bugs in this XML document.
Several tags are wrong do to my function renaming yesterday:
</process_outputs>
</process_description>
</wps:process_descriptions>
...

I have fixed this in grass7 svn to provide conform WPS XML support.
The validation tool i use, which validates the XML files against the
OGC xsd files,
says everything is correct now.

> Furthermore, you use a node for MimeType, I've understood that in the WPS
> proposal, when they use the first letter capitalized that means that we have
> to use a node. But for mimeType it was specified as-is, so I'm pretty sure
> that it have to be used as an attribute of the ComplexData node. Please
> correct me if I'm wrong.

The MimeType should be a separate element within the Format element in
ComplexData, see table 23 in OGC 07-007r07 document.

Have a look at the reference example:
http://schemas.opengis.net/wps/1.0.0/examples/40_wpsDescribeProcess_response.xml

> Maybe that's why we have to create a parser to be able to use the
> DescribeProcess as source for creating the zcfg file which specify the
> process' metadata.

Nope. The WPS output generated by grass must be WPS 1.0.0 compatibel,
everything else is not acceptable.
In case you or somebody else will find incompatibilities, i will fix
it as fast as i can.

Best regards
Soeren


Here is a correct WPS process description of r.grow:

<?xml version="1.0" encoding="UTF-8"?>
<wps:ProcessDescriptions 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
 http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd"
 service="WPS" version="1.0.0" xml:lang="en-US">
	<ProcessDescription wps:processVersion="1" storeSupported="true"
statusSupported="true">
				<ows:Identifier>r.grow</ows:Identifier>
				<ows:Title>Generates a raster map layer with contiguous areas
grown by one cell.</ows:Title>
				<ows:Abstract>Generates a raster map layer with contiguous areas
grown by one cell.</ows:Abstract>
		<ows:Metadata xlink:title="raster" />
		<DataInputs>
			<Input minOccurs="1" maxOccurs="1">
				<ows:Identifier>input</ows:Identifier>
				<ows:Title>Name of input raster map</ows:Title>
				<ows:Abstract>Name of input raster map</ows:Abstract>
				<ComplexData maximumMegabytes="2048">
					<Default>
						<Format>
							<MimeType>image/tiff</MimeType>
						</Format>
					</Default>
					<Supported>
						<Format>
							<MimeType>image/tiff</MimeType>
						</Format>
						<Format>
							<MimeType>image/png</MimeType>
						</Format>
						<Format>
							<MimeType>application/grass-raster-ascii</MimeType>
						</Format>
						<Format>
							<MimeType>application/grass-raster-binary</MimeType>
						</Format>
					</Supported>
				</ComplexData>
			</Input>
			<Input minOccurs="0" maxOccurs="1">
				<ows:Identifier>radius</ows:Identifier>
				<ows:Title>Radius of buffer in raster cells</ows:Title>
				<ows:Abstract>Radius of buffer in raster cells</ows:Abstract>
				<LiteralData>
					<ows:DataType ows:reference="xs:float">float</ows:DataType>
					<ows:AnyValue/>
					<DefaultValue>1.01</DefaultValue>
				</LiteralData>
			</Input>
			<Input minOccurs="0" maxOccurs="1">
				<ows:Identifier>metric</ows:Identifier>
				<ows:Title>Metric</ows:Title>
				<ows:Abstract>Metric</ows:Abstract>
				<LiteralData>
					<ows:DataType ows:reference="xs:string">string</ows:DataType>
					<ows:AllowedValues>
						<ows:Value>euclidean</ows:Value>
						<ows:Value>maximum</ows:Value>
						<ows:Value>manhattan</ows:Value>
					</ows:AllowedValues>
					<DefaultValue>euclidean</DefaultValue>
				</LiteralData>
			</Input>
			<Input minOccurs="0" maxOccurs="1">
				<ows:Identifier>old</ows:Identifier>
				<ows:Title>Value to write for input cells which are non-NULL (-1
=> NULL)</ows:Title>
				<ows:Abstract>Value to write for input cells which are non-NULL
(-1 => NULL)</ows:Abstract>
				<LiteralData>
					<ows:DataType ows:reference="xs:integer">integer</ows:DataType>
					<ows:AnyValue/>
				</LiteralData>
			</Input>
			<Input minOccurs="0" maxOccurs="1">
				<ows:Identifier>new</ows:Identifier>
				<ows:Title>Value to write for "grown" cells</ows:Title>
				<ows:Abstract>Value to write for "grown" cells</ows:Abstract>
				<LiteralData>
					<ows:DataType ows:reference="xs:integer">integer</ows:DataType>
					<ows:AnyValue/>
				</LiteralData>
			</Input>
			<Input minOccurs="0" maxOccurs="1">
				<ows:Identifier>-m</ows:Identifier>
				<ows:Title>radius is in map units rather than cells</ows:Title>
				<ows:Abstract>radius is in map units rather than cells</ows:Abstract>
				<LiteralData>
					<ows:DataType ows:reference="xs:boolean">boolean</ows:DataType>
					<ows:AllowedValues>
						<ows:Value>true</ows:Value>
						<ows:Value>false</ows:Value>
					</ows:AllowedValues>
					<DefaultValue>false</DefaultValue>
				</LiteralData>
			</Input>
		</DataInputs>
		<ProcessOutputs>
			<Output>
				<ows:Identifier>output</ows:Identifier>
				<ows:Title>Name for output raster map</ows:Title>
				<ows:Abstract>Name for output raster map</ows:Abstract>
				<ComplexOutput>
					<Default>
						<Format>
							<MimeType>image/tiff</MimeType>
						</Format>
					</Default>
					<Supported>
						<Format>
							<MimeType>image/tiff</MimeType>
						</Format>
						<Format>
							<MimeType>image/png</MimeType>
						</Format>
						<Format>
							<MimeType>application/grass-raster-ascii</MimeType>
						</Format>
						<Format>
							<MimeType>application/grass-raster-binary</MimeType>
						</Format>
					</Supported>
				</ComplexOutput>
			</Output>
		</ProcessOutputs>
	</ProcessDescription>
</wps:ProcessDescriptions>



More information about the Zoo-discuss mailing list