Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"FeatureType Grid Widget" returns empty geometries when a spatial filter is set #8460

Closed
afabiani opened this issue Dec 2, 2021 · 3 comments
Assignees
Labels
3.2.x 3.3.x frontend Issues regarding Frontend and styling master regression Issues related to regressions.

Comments

@afabiani
Copy link
Member

afabiani commented Dec 2, 2021

Expected Behavior

When trying to download a dataset with a spatial filter applied like shown her below, I'd expect the process correctly generating the output file

image

image

Actual Behavior

The Download Process fails with an Empty Geometries Null Pointer Exception error

image

Steps to Reproduce the Problem

  1. Open the grid editor widget on a vectorial dataset
  2. Create a map filter
  3. Try to download the filtered data

Specifications

  • GeoNode version: 4.0, 3.3, 3.2
  • Installation method (manual, GeoNode Docker, SPCGeoNode Docker): any
  • Platform: any
  • Additional details:
@afabiani afabiani added regression Issues related to regressions. frontend Issues regarding Frontend and styling labels Dec 2, 2021
@afabiani afabiani added this to the 3.2.3 milestone Dec 2, 2021
@luorlandini
Copy link
Contributor

after some investigation, the problem seems to be on the geoserver side

this is the request done to geoserver:

url: https://localhost:8081/geoserver/ows?service=WPS&version=1.0.0&REQUEST=Execute&access_token=8K6lZPHv1Vx7poFaxgM8uDE9b0mhgw
payload:

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:dwn="http://geoserver.org/wps/download" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" service="WPS" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
   <ows:Identifier>gs:Download</ows:Identifier>
   <wps:DataInputs>
      <wps:Input>
         <ows:Identifier>layerName</ows:Identifier>
         <wps:Data>
            <wps:LiteralData>geonode:wilayas_58</wps:LiteralData>
         </wps:Data>
      </wps:Input>
      <wps:Input>
         <ows:Identifier>outputFormat</ows:Identifier>
         <wps:Data>
            <wps:LiteralData>application/zip</wps:LiteralData>
         </wps:Data>
      </wps:Input>
      <wps:Input>
         <ows:Identifier>filter</ows:Identifier>
         <wps:Data>
            <wps:ComplexData mimeType="text/xml; subtype=filter/1.1"><![CDATA[<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:And><ogc:Intersects><ogc:PropertyName>geometry</ogc:PropertyName><gml:Polygon srsName="EPSG:3857"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>90319.02643363085,3414964.3591960706 90319.02643363085,3991448.246372885 687801.5984746646,3991448.246372885 687801.5984746646,3414964.3591960706 90319.02643363085,3414964.3591960706</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogc:Intersects></ogc:And></ogc:Filter>]]></wps:ComplexData>
         </wps:Data>
      </wps:Input>
      <wps:Input>
         <ows:Identifier>cropToROI</ows:Identifier>
         <wps:Data>
            <wps:LiteralData>false</wps:LiteralData>
         </wps:Data>
      </wps:Input>
   </wps:DataInputs>
   <wps:ResponseForm>
      <wps:ResponseDocument storeExecuteResponse="true" status="true">
         <wps:Output asReference="true">
            <ows:Identifier>result</ows:Identifier>
         </wps:Output>
      </wps:ResponseDocument>
   </wps:ResponseForm>
</wps:Execute>

this is the response about that request:

<?xml version="1.0" encoding="UTF-8"?>
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en" service="WPS" serviceInstance="https://master.demo.geonode.org/geoserver/ows?" statusLocation="https://master.demo.geonode.org/geoserver/ows?service=WPS&amp;version=1.0.0&amp;request=GetExecutionStatus&amp;executionId=fba695c2-263a-40b4-aa6d-8b17a90867b4" version="1.0.0">
   <wps:Process wps:processVersion="1.0.0">
      <ows:Identifier>gs:Download</ows:Identifier>
      <ows:Title>Enterprise Download Process</ows:Title>
      <ows:Abstract>Downloads Layer Stream and provides a ZIP.</ows:Abstract>
   </wps:Process>
   <wps:Status creationTime="2021-12-03T15:20:56.688Z">
      <wps:ProcessFailed>
         <ows:ExceptionReport version="1.1.0">
            <ows:Exception exceptionCode="NoApplicableCode">
               <ows:ExceptionText>Process failed during execution
java.lang.IllegalStateException: Got an empty feature collection.
Got an empty feature collection.</ows:ExceptionText>
            </ows:Exception>
         </ows:ExceptionReport>
      </wps:ProcessFailed>
   </wps:Status>
</wps:ExecuteResponse>

mapstore send wps:Data, unless the ogc filter is not valid for geoserver, the problem seems to be on that side

@giohappy giohappy removed this from the 3.2.3 milestone Dec 9, 2021
@giohappy giohappy changed the title Filtered download from "FeatureType Grid Widget" returns empty geometries "FeatureType Grid Widget" returns empty geometries when a spatial filter is set Feb 4, 2022
@giohappy
Copy link
Contributor

giohappy commented Feb 4, 2022

Notice that when the same polygon is set a ROI input to the WPS process, everything works fine.
Attributes filters are also working fine.

@giohappy
Copy link
Contributor

giohappy commented Mar 1, 2022

Issue moved to GeoNode/geonode-mapstore-client #852 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.x 3.3.x frontend Issues regarding Frontend and styling master regression Issues related to regressions.
Projects
None yet
Development

No branches or pull requests

5 participants