[Geoserver-devel] [JIRA] (GEOS-10811) GeoServer 2.22.0 WPS error while clipping raster with GeoJSON input

Pratik Mahadik created an issue

GeoServer / BugGEOS-10811

GeoServer 2.22.0 WPS error while clipping raster with GeoJSON input

Issue Type:

BugBug

Affects Versions:

2.20.0, 2.21.0, 2.22.0

Assignee:

Unassigned

Components:

WPS

Created:

02/Jan/23 6:02 PM

Environment:

Linux, Windows

Priority:

HighHigh

Reporter:

Pratik Mahadik

When I try to run a WPS process for clipping a WCS raster data with a GeoJSON data it fails to complete the job. But when I do the same with WKT string as a input it completes successfully.

Failed WPS process with JSON input

<?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>ras:CropCoverage</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>coverage</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>nu:NE2_50M_SR</ows:Identifier>
            <wcs:DomainSubset>
              <ows:BoundingBox crs="http://www.opengis.net/gml/srs/epsg.xml#4326">
                <ows:LowerCorner>-180.0 -90.0</ows:LowerCorner>
                <ows:UpperCorner>180.0 90.0</ows:UpperCorner>
              </ows:BoundingBox>
            </wcs:DomainSubset>
            <wcs:Output format="image/tiff"/>
          </wcs:GetCoverage>
        </wps:Body>
      </wps:Reference>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>cropShape</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="application/json"><![CDATA[
         {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            74.332365694231868,
                            20.348533699212016
                        ],
                        [
                            74.005883315616018,
                            18.018636724544315
                        ],
                        [
                            76.988745047515422,
                            16.875948399388822
                        ],
                        [
                            74.332365694231868,
                            20.348533699212016
                        ]
                    ]
                ]
            }
        
        ]]>
        </wps:ComplexData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput mimeType="image/jpeg">
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm>
</wps:Execute>

Geoserver log error message

08 Dec 14:35:12 ERROR [wps.executor] - Process execution failed
org.geoserver.wps.WPSException: Failed to retrieve value for input cropShape
       at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:97)
       at org.geoserver.wps.executor.LazyInputMap.get(LazyInputMap.java:49)
       at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:736)
       at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:616)
       at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50)
       at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:224)
       at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:192)
       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureHandler.<init>(org.locationtech.jts.geom.GeometryFactory)
       at org.geotools.geojson.DelegatingHandler.createDelegate(DelegatingHandler.java:125)
       at org.geotools.geojson.geom.GeometryHandler.primitive(GeometryHandler.java:58)
       at org.json.simple.parser.JSONParser.parse(JSONParser.java:428)
       at org.json.simple.parser.JSONParser.parse(JSONParser.java:312)
       at org.geotools.geojson.GeoJSONUtil.parse(GeoJSONUtil.java:278)
       at org.geotools.geojson.geom.GeometryJSON.parse(GeometryJSON.java:623)
       at org.geotools.geojson.geom.GeometryJSON.read(GeometryJSON.java:181)
       at org.geoserver.wps.ppio.GeoJSONPPIO$Geometries.decode(GeoJSONPPIO.java:104)
       at org.geoserver.wps.ppio.CDataPPIO.decode(CDataPPIO.java:21)
       at org.geoserver.wps.executor.SimpleInputProvider.getValueInternal(SimpleInputProvider.java:81)
       at org.geoserver.wps.executor.AbstractInputProvider.getValue(AbstractInputProvider.java:100)
       at org.geoserver.wps.executor.ValidatingInputProvider.getValue(ValidatingInputProvider.java:39)
       at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:89)
       ... 10 more
Caused by: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureHandler.<init>(org.locationtech.jts.geom.GeometryFactory)
       at java.base/java.lang.Class.getConstructor0(Class.java:3349)
       at java.base/java.lang.Class.getConstructor(Class.java:2151)
       at org.geotools.geojson.DelegatingHandler.createDelegate(DelegatingHandler.java:119)
       ... 22 more

This issue is not seen in GeoServer 2.18.0 when I tested it.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100213-sha1:d1b903b)

Atlassian logo