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 #852

Closed
giohappy opened this issue Mar 1, 2022 · 11 comments
Assignees

Comments

@giohappy
Copy link

giohappy commented Mar 1, 2022

@afabiani commented on Thu Dec 02 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:

@luorlandini commented on Fri Dec 03 2021

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 commented on Fri Feb 04 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
Author

giohappy commented Mar 1, 2022

Bug report created for MapStore geosolutions-it/MapStore2#7893

@giohappy
Copy link
Author

Upstream PR has been mertged.
We're waiting for its backport to the stable branch of MapStore.
GeoNode client submodule will be aligned afterwards.

@giohappy
Copy link
Author

@marthamareal to be tested

@marthamareal
Copy link

I have tested this with master.demo and development.demo. But both are failing. see images below

ss
ss1

@giohappy
Copy link
Author

@DavidQuartz can you please inspect the WPS request and verify that the MapStore fix is actually there?

@DavidQuartz
Copy link
Member

@giohappy I confirm that the fix is actually there. I made a quick test with the same datasets as @marthamareal on master and dev instances and both were successul.

Screenshot 2022-03-17 at 11 42 22

Screenshot 2022-03-17 at 11 45 18

Seeing from the error @marthamareal is getting, it's not related to the initial GML error. I suspect it may be related to this issue on mapstore about failing exports which should currently be under investigation on the server side.

@giohappy
Copy link
Author

@marthamareal can you confirm it's happening only for download formats except CSV? This is what the issue reported by @DavidQuartz says.

@marthamareal
Copy link

Yes that's correct. It only succeeds on CSV format

@marthamareal
Copy link

After clearing my browser cache, Export is successful for all available formats on both master.demo and development.demo.

@giohappy
Copy link
Author

Apparently, this depends on the version of Geoserver. MS is using GS 2.20 SNAPSHOT while GN is still on 2.19 SNAPSHOT.
So I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants