The WPS PagedUnique process will give wrong results if the input layer name exists in two different workspaces.
In GeoServer 2.8.5 the process will fail with a message “Failed to retrieve value for input features
Could not locate TEST_LAYER in catalog.”
In GeoServer 2.13.x the proces will succeed with wrong results.
To reproduce with the standard data_dir:
- Re-publish the tiger:poi layer and name it TEST_LAYER
- Re-publish the sf:restricted layer and name it TEST_LAYER
- Query the tiger:TEST_LAYER to get all the values of the “NAME” property, the WPS body follows:
<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0" version="1.0.0" service="WPS" 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/wpsAll.xsd">
<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">gs:PagedUnique</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">features</ows:Identifier>
<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">features</ows:Title>
<wps:Data/>
<wps:Reference mimeType="text/xml" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://geoserver/wfs" method="POST">
<wps:Body>
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0">
<wfs:Query typeName="tiger:TEST_LAYER">
<ogc:SortBy xmlns:ogc="http://www.opengis.net/ogc">
<ogc:SortProperty>
<ogc:PropertyName>NAME</ogc:PropertyName>
</ogc:SortProperty>
</ogc:SortBy>
</wfs:Query>
</wfs:GetFeature>
</wps:Body>
</wps:Reference>
</wps:Input>
<wps:Input>
<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">fieldName</ows:Identifier>
<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">fieldName</ows:Title>
<wps:Data>
<wps:LiteralData>NAME</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">maxFeatures</ows:Identifier>
<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">maxFeatures</ows:Title>
<wps:Data>
<wps:LiteralData>10</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:RawDataOutput mimeType="application/json">
<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">result</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>
GeoServer 2.8.5 will fail, GeoServer 2.13 will return the correct results.
- Use the same request and just change the workspace name of the layer
<wfs:Query typeName="sf:TEST_LAYER">
GeoServer 2.8.5 will fail, GeoServer 2.13 will return the previous results (the tiger:TEST_LAYER one)
Note that the sf:TEST_LAYER does not have a “NAME” property.
|