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

join With Intersects test error #164

Closed
danieluct opened this issue Feb 3, 2020 · 12 comments · Fixed by #168
Closed

join With Intersects test error #164

danieluct opened this issue Feb 3, 2020 · 12 comments · Fixed by #168
Assignees
Projects
Milestone

Comments

@danieluct
Copy link

The current spatial join implementation at

imposes several requirements not mentioned in the standard (e.g.: there must be two distinct geometries in the feature types server by the WFS, neither of whom can be defined as gml:AbstractGeometryType, and, except in the case both of these are AbstractCurveType, one of them must be AbstractSurfaceType). Test should be skipped in case none of this test implementation requirements are fulfilled by the service.

@dstenger
Copy link
Contributor

dstenger commented Feb 3, 2020

Thank you for reporting. We will do further investigation.

@ghobona
Copy link
Contributor

ghobona commented Mar 20, 2020

Reviewing the spec, here is what I can deduce as the source/justification of the test.

Part of Test "A.1.12 Spatial joins" in OGC 09-025r2 says "Verify that conformance tests OGC 09-026r2, A.7 and A.8 are satisfied."

Part of Test "A.8 Test cases for spatial filter" in OGC 09-026r2 says "Verify that one or more additional spatial operators are listed in the filter capabilities document. Submit requests and check that the additional spatial operators work according to their description.".

So the method SpatialJoinTests.joinWithIntersects() verifies that if the server lists the Intersect spatial operator amongst its filter capabilities, then the Intersect spatial operator works accordingly.

Now since, the method SpatialJoinTests.joinWithIntersects() currently only lists a small set of permutations of geometry types, I agree it is reasonable for the SpatialJoinTests.joinWithIntersects() to be skipped if none of the listed permutations are implemented.

@keshav-nangare @dstenger We could, for example, skip the SpatialJoinTests.joinWithIntersects() and then throw an Exception for the Test "A.8 Test cases for spatial filter" to be verified manually.

@dstenger
Copy link
Contributor

dstenger commented Mar 24, 2020

The CITE team decided to add an else block to SpatialJoinTests.joinWithIntersects() which is throwing an AssertionError.
@ghobona Can you please provide a short text for the exception?

Further, we will update the documentation by adding a precondition to the test suite.

@ghobona
Copy link
Contributor

ghobona commented Apr 6, 2020

Something like this could be added to SpatialJoinTests.joinWithIntersects() :

        else if (!this.curveProps.isEmpty() && !this.pointProps.isEmpty()) {
            // curve property
            Iterator<Map.Entry<QName, List<XSElementDeclaration>>> itrCurveProps = this.curveProps.entrySet().iterator();
            Entry<QName, List<XSElementDeclaration>> entryCurveProps = itrCurveProps.next();
            joinProperties.add(new FeatureProperty(entryCurveProps.getKey(), entryCurveProps.getValue().get(0)));
            
            // point property
            Iterator<Map.Entry<QName, List<XSElementDeclaration>>> itrPointProps = this.pointProps.entrySet().iterator();
            Entry<QName, List<XSElementDeclaration>> entryPointProps = itrPointProps.next();
            joinProperties.add(new FeatureProperty(entryPointProps.getKey(), entryPointProps.getValue().get(0)));         
        }
        else{
           Assert.fail("This test has triggered an unexpected Spatial Join condition. The Spatial Join test will need to be applied manually.");       
        } 

@dstenger
Copy link
Contributor

dstenger commented Apr 6, 2020

@keshav-nangare Can you please add those changes to the code, test it and create a pull request?

@keshavnangare
Copy link

@dstenger

I have added changes as per the suggestion and created the PR #168. Tested the changes locally with service[1] but test getting skipped.

[1] https://services.interactive-instruments.de/ogc-reference-2/simple/wfs?request=getcapabilities&service=wfs

Do we have another service to test these changes?

@dstenger
Copy link
Contributor

dstenger commented Apr 8, 2020

@danieluct Is it possible to provide a test service making it possible for us to verify the changes?

@ghobona
Copy link
Contributor

ghobona commented Apr 8, 2020

@keshav-nangare In addition to the service provided by @danieluct , please also try this one.

@danieluct
Copy link
Author

danieluct commented Apr 8, 2020

@dstenger
This service contains only points and multipoints https://inspire.meteoromania.ro/WIGOS/WFS?request=GetCapabilities&service=WFS&version=2.0.2
We also have an older instance, which is not actively maintained and is less compliant with CITE tests, but has (multi)polygons http://gmlid.eu/RO/ENV/PADS/WFS?service=wfs&verison=2.0.0&request=GetCapabilities

@keshavnangare
Copy link

@dstenger @ghobona

[1] https://demo.geo-solutions.it/geoserver/ows?service=wfs&version=2.0.0&request=GetCapabilities
[2] https://inspire.meteoromania.ro/WIGOS/WFS?request=GetCapabilities&service=WFS&version=2.0.2

Following are the test results after changes:

  • Tested with service [1], it throws below exception
Fatal Error: Error in call to extension function {public javax.xml.transform.Source org.opengis.cite.iso19142.TestNGController.doTestRun(org.w3c.dom.Document) throws java.lang.Exception}: Exception in extension function java.lang.RuntimeException: Default CRS not recognized. No code ?EPSG:404000? from authority ?European Petroleum Survey Group? found for object of type ?CoordinateReferenceSystem?.; SystemID: file:/C:/TE_BASE/work/_TE_BASE_scripts_wfs_2.0.0_ctl_/wfs-suite/tns$run-ets-wfs20.fn; Line#: 50; Column#: -1
Fatal Error: Error in call to extension function {public java.lang.Object com.occamlab.te.TECore.callFunction(net.sf.saxon.expr.XPathContext,java.lang.String,java.lang.String,net.sf.saxon.om.NodeInfo) throws java.lang.Exception}: Exception in extension function net.sf.saxon.s9api.SaxonApiException: Error in call to extension function {public javax.xml.transform.Source org.opengis.cite.iso19142.TestNGController.doTestRun(org.w3c.dom.Document) throws java.lang.Exception}: Exception in extension function java.lang.RuntimeException: Default CRS not recognized. No code ?EPSG:404000? from authority ?European Petroleum Survey Group? found for object of type ?CoordinateReferenceSystem?.; SystemID: file:/C:/TE_BASE/work/_TE_BASE_scripts_wfs_2.0.0_ctl_/wfs-suite/tns$Main.test; Line#: 126; Column#: -1
  • Tested with service [2], it worked as we expected. We can see assertion message in below result :
    image

@danieluct
Copy link
Author

Hi,
The INSPIRE validator team informed us that they are not able to check the failure message, and therefore any result requiring a manual check should be marked as skipped: https://github.com/inspire-eu-validation/community/issues/209#issuecomment-680745458 .
Marking it as skipped instead of error also seems more in line with how ets-wfs20 deals in other cases with valid missing pre-requisites (e.g. no temporal properties on features).

Alternatively, the test could also include the two geometry intersections still missing (points with points, and curves with curves)

@dstenger
Copy link
Contributor

dstenger commented Sep 8, 2020

@danieluct Thank you for your comment. We are fine with skipping the test when the geometry type is not supported and created a new issue: #175

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

Successfully merging a pull request may close this issue.

5 participants