Questions:
Q1: If I shorten they “keys” how much client code am I going to break?
Q2: Can I make the annotations consistent for @DescribeProcess @DescribeParam @DescribeResult ?
I would like to go for:
- name (optional) name for the provided input, result or process if provided. If not provided the name is taken from the java definition
- title - the display name or title used (optional) defaults to the “name”
- description - description used in the capabilities or describe process
Issues:
-
@DescribeProcess title is not used; is this on purpose?
-
The @DescribeProcess and @DescribeParameter are inconsistent in hiding java details or advertising them (where the java class name was used; in this case the attribute name is not used)
-
the name “name of the layer attribute containing the width of the buffer” is a very long key
-
the “name of the layer attribute containing the width of the buffer” cannot actually be used; it always fails with the indication that it must have a value as minOccurs != 0; setting it to an empty string does not work
In short I am not finding “gs:BufferFeatureCollection” to be a good replacement for the “gt:BufferedFeatureCollection” I just deleted. I have been trying to update the geoserver tests one at a time; and given the issue with “name of the layer attribute containing the width of the buffer” I am not super confident that those code here has been used in the wild?
Update: changing the multiplicity of “name of the layer attribute containing the width of the buffer” in min = 0 allows tests to pass in GeoServer:
@DescribeParameter(name = “name of the layer attribute containing the width of the buffer”, description = “Name of the layer attribute”,min=0) String attribute) {
Background Examples For Discussion
@DescribeProcess(title = “buffer”, description = “Buffers each feature in a collection by a fixed amount or by a value coming from a feature attribute. Works in pure cartesian mode.”)
public class BufferFeatureCollection implements GSProcess {
public SimpleFeatureCollection execute(
@DescribeParameter(name = “feature collection”, description = “Feature collection”) SimpleFeatureCollection features,
@DescribeParameter(name = “width of the buffer”, description = “The width of the buffer”) Double distance,
@DescribeParameter(name = “name of the layer attribute containing the width of the buffer”, description = “Name of the layer attribute”) String attribute) {
Resulting in:
<wps:Process wps:processVersion=“1.0.0”>
ows:Identifiergs:BufferFeatureCollection</ows:Identifier>
ows:TitleBuffers each feature in a collection by a fixed amount or by a value coming from a feature attribute. Works in pure cartesian mode.</ows:Title>
ows:AbstractBuffers each feature in a collection by a fixed amount or by a value coming from a feature attribute. Works in pure cartesian mode.</ows:Abstract>
</wps:Process>
And:
<?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” service=“WPS” version=“1.0.0” xml:lang=“en” xsi:schemaLocation=“http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd”>
ows:Identifiergs:BufferFeatureCollection</ows:Identifier>
ows:TitleBuffers each feature in a collection by a fixed amount or by a value coming from a feature attribute. Works in pure cartesian mode.</ows:Title>
ows:AbstractBuffers each feature in a collection by a fixed amount or by a value coming from a feature attribute. Works in pure cartesian mode.</ows:Abstract>
ows:Identifierfeature collection</ows:Identifier>
ows:Titlefeature collection</ows:Title>
ows:AbstractFeature collection</ows:Abstract>
text/xml; subtype=wfs-collection/1.0
text/xml; subtype=wfs-collection/1.0
text/xml; subtype=wfs-collection/1.1
application/json
application/wfs-collection-1.0
application/wfs-collection-1.1
application/zip
ows:Identifierwidth of the buffer</ows:Identifier>
ows:Titlewidth of the buffer</ows:Title>
ows:AbstractThe width of the buffer</ows:Abstract>
ows:DataTypexs:double</ows:DataType>
ows:Identifiername of the layer attribute containing the width of the buffer</ows:Identifier>
ows:Titlename of the layer attribute containing the width of the buffer</ows:Title>
ows:AbstractName of the layer attribute</ows:Abstract>
ows:Identifierresult</ows:Identifier>
ows:Titleresult</ows:Title>
text/xml; subtype=wfs-collection/1.0
text/xml; subtype=wfs-collection/1.0
text/xml; subtype=wfs-collection/1.1
application/json
application/wfs-collection-1.0
application/wfs-collection-1.1
application/zip
</wps:ProcessDescriptions>
In order to call the above …
“wps:DataInputs” +
“wps:Input” +
“ows:Identifierfeature collection</ows:Identifier>” +
“wps:Data” +
“wps:ComplexData” +
readFileIntoString(“states-FeatureCollection.xml”) +
“</wps:ComplexData>” +
“</wps:Data>” +
“</wps:Input>” +
“wps:Input” +
“ows:Identifierwidth of the buffer</ows:Identifier>” +
“wps:Data” +
“wps:LiteralData10</wps:LiteralData>” +
“</wps:Data>” +
“</wps:Input>” +
“wps:Input” +
“ows:Identifiername of the layer attribute containing the width of the buffer</ows:Identifier>” +
“wps:Data” +
“wps:LiteralData</wps:LiteralData>” +
“</wps:Data>” +
“</wps:Input>” +
“</wps:DataInputs>”
–
Jody Garnett
On Saturday, 27 August 2011 at 1:40 AM, Jody Garnett wrote:
Process clarification question
For the following with have a java bean defined; with an annotation to fill in the missing information:
DescribeProcess(title = “rectangularClip”, description = “Clips the features to the specified geometry”)
public class ClipProcess implements GSProcess {
…
}I ran into a bad assumption when writing a test case …
To find the above process:
new NameImpl(“gs”,“ClipProcess”) works
new NameImpl(“gs”,“rectangularClip”) does not work
Does the WPS spec have the concept of a display name? I would of expected that “rectangularClip” is used rather than the java bean name; if only so we can follow normal java naming conventions for our java beans without watching things get out of hand.
–
Jody Garnett