Hi list,
I'm trying to make a WPS request work. More precisely, I'm using the Contour process on a raster layer. In the SLD styles I have various levels defined for the Contour process, but I cannot make the "levels" parameter (array of type double) work in the WPS request alone. I originally used the request builder for the request, where I saw a singular field for the levels parameter. Whatever I try, it doesn't produce the output I want.
I vaguely remember some WPS process describing to separate values by a comma or a semicolon.
I've tried entering the levels with various separators, which always produces this error:
TRACE [geotools.util] - Error applying the converter class org.geotools.data.util.NumericConverterFactory$NumericConverter on (1014.0;1016.0,double)
java.lang.NumberFormatException: For input string: "1014.0;1016.0"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(Unknown Source)
at java.base/java.lang.Double.parseDouble(Unknown Source)
at java.base/java.lang.Double.valueOf(Unknown Source)
at org.geotools.data.util.NumericConverterFactory$NumericConverter.convertInternal(NumericConverterFactory.java:270)
at org.geotools.data.util.NumericConverterFactory$NumericConverter.convert(NumericConverterFactory.java:199)
at org.geotools.util.Converters.convert(Converters.java:150)
at org.geotools.util.Converters.convert(Converters.java:117)
...
ERROR [wps.executor] - Process execution failed
org.geotools.process.ProcessException: Could not convert [null] to target type [D
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:763)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:628)
at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:222)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:191)
Then I've tried manually editing the request XML like so:
<wps:Input>
<ows:Identifier>levels</ows:Identifier>
<wps:Data>
<wps:LiteralData>1014</wps:LiteralData>
<wps:LiteralData>1016</wps:LiteralData>
</wps:Data>
</wps:Input>
or
<wps:Input>
<ows:Identifier>levels</ows:Identifier>
<wps:Data>
<wps:LiteralData type="array">
<value>1014</value>
<value>1016</value>
</wps:LiteralData>
</wps:Data>
</wps:Input>
and so on. These result in only the last value (in these cases 1016) to be considered. If I use an interval, I do see the result with the other levels listed (1014) as well.
How does one define an array in the WPS request XMLs? Am I missing something else? Is it possible to define this in the request builder?
Geoserver 2.23.0
Full request example:
<?xml version="1.0" encoding="UTF-8"?><wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gs:Contour</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>data</ows:Identifier>
<wps:Reference mimeType="image/tiff" xlink:href="http://geoserver/wcs" method="POST">
<wps:Body>
<wcs:GetCoverage service="WCS" version="1.1.1">
<ows:Identifier>models:wps_test</ows:Identifier>
<wcs:DomainSubset>
<ows:BoundingBox crs="http://www.opengis.net/gml/srs/epsg.xml#3857">
<ows:LowerCorner>-2.0037494753984205E7 -1.6642531881651504E7</ows:LowerCorner>
<ows:UpperCorner>2.0015180468541145E7 1.6627028988671975E7</ows:UpperCorner>
</ows:BoundingBox>
</wcs:DomainSubset>
<wcs:Output format="image/tiff"/>
</wcs:GetCoverage>
</wps:Body>
</wps:Reference>
</wps:Input>
<wps:Input>
<ows:Identifier>levels</ows:Identifier>
<wps:Data>
<wps:LiteralData>1014</wps:LiteralData>
<wps:LiteralData>1016</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:RawDataOutput mimeType="text/xml; subtype=wfs-collection/1.0">
<ows:Identifier>result</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>
Thank you in advance for any tips or answers.
Regards
Kamilla Kisova