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

On Sat, 2 Jun 2018 at 13:14, <[email protected]> wrote:

> 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:Identifier>gs:GridTabularGeographic</ows:Identifier>
>   <wps:DataInputs>
>     <wps:Input>
>       <ows:Identifier>point</ows:Identifier>
>       <wps:Data>
>         <wps:ComplexData mimeType="application/json">
>             <![CDATA[
>         {
>             "type": "Point",
>             "coordinates": [
>                 [
>                     30,
>                     31
>                 ]
>             ],
>             "crs": {
>                 "type": "name",
>                 "properties": {
>                 "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
>                 }
>             }
>         }
>         ]]>
>         </wps:ComplexData>
>       </wps:Data>
>     </wps:Input>
>   </wps:DataInputs>
>   <wps:ResponseForm>
>     <wps:RawDataOutput mimeType="application/json">
>       <ows:Identifier>result</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
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


-- 
Ian Turton
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to