[Geoserver-users] Setting SRID in WPS request

Hi,
I’ve a custom WPS process that accepts a point then does some calculations.
I’m calling it using the following request:

<?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:Identifiergs:GridTabularGeographic</ows:Identifier>
wps:DataInputs
wps:Input
ows:Identifierpoint</ows:Identifier>
wps:Data
<wps:ComplexData mimeType=“application/json”>

</wps:ComplexData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
wps:ResponseForm
<wps:RawDataOutput mimeType=“application/json”>
ows:Identifierresult</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>

Inside the WPS function I’m reading the SRID of the passed point, it returns zero !!

Here is my function:
@DescribeProcess(title = “GridTabularGeographic”, description = “Creates a new tabular grid, in geographic coordinates.”)
public class GridTabularGeographic implements GeoServerProcess {

@DescribeResult(name = “result”, description = “output result”)
public int execute(@DescribeParameter(name = “point”, description = “Top left point”) com.vividsolutions.jts.geom.Geometry.Geometry point) {
int srid = point.getSRID(); //srid is 0 !!

}
}

So, although I’m passing SRID = 4326 in the geojson, the function see it as 0. What is the problem?

I’ve also tried the following in the geojson:

{
“type”: “Point”,
“coordinates”: [
[
30,
31
]
],
“crs”: {
“type”: “name”,
“properties”: {
“name”: “EPSG:4326”}
}
}

With the same results.

Regards,
Fawzy

The problem is that GeoTools never sets the JTS srid on geometries, AFAIK no one uses that at all.

I would add a separate SRS parameter (may be defaulting to 4326) to solve this or pass in a feature rather than a geometry.

Ian

···

Ian Turton

Thanks a lot Ian for your reply.

I think I should pass it as a parameter.

Regards,
Fawzy

···

Ian Turton