Class SpatialJoinTests


public class SpatialJoinTests extends QueryFilterFixture
A spatial join includes a spatial predicate. One or more of the following spatial predicates must be supported:
  • Equals
  • Disjoint
  • Intersects
  • Touches
  • Crosses
  • Within
  • Contains
  • Overlaps
  • Beyond
  • DWithin

A sample GetFeature request entity is shown below, where the "Intersects" predicate refers to the geometry properties of two different feature types.

 <wfs:GetFeature version="2.0.0" service="WFS"
   xmlns:tns="http://example.org/ns1"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"
   xmlns:fes="http://www.opengis.net/fes/2.0">
   <wfs:Query typeNames="tns:Parks tns:Lakes">
     <fes:Filter>
       <fes:Intersects>
         <fes:ValueReference>tns:Parks/tns:geometry</fes:ValueReference>
         <fes:ValueReference>tns:Lakes/tns:geometry</fes:ValueReference>
       </fes:Intersects>
     </fes:Filter>
   </wfs:Query>
 </wfs:GetFeature>
 

Sources

  • OGC 09-025r2, 7.9.2.5.3: Join processing
  • OGC 09-025r2, A.1.12: Spatial joins
  • OGC 09-026r2, A.8: Test cases for spatial filter
  • Field Details

  • Constructor Details

    • SpatialJoinTests

      public SpatialJoinTests()
  • Method Details

    • findGeometryProperties

      Map<QName,List<org.apache.xerces.xs.XSElementDeclaration>> findGeometryProperties(String gmlTypeName)
      Searches the application schema for geometry properties where the value is an instance of the given type.
      Parameters:
      gmlTypeName - The name of a GML geometry type (may be abstract).
      Returns:
      A Map containing, for each feature type name (key), a list of matching geometry properties (value).
    • implementsSpatialJoins

      @BeforeTest public void implementsSpatialJoins(org.testng.ITestContext testContext)
      Checks the value of the service constraint "ImplementsSpatialJoins" in the capabilities document. All tests are skipped if this is not "TRUE".
      Parameters:
      testContext - Information about the test run environment.
    • initFixture

      @BeforeClass public void initFixture()
      Initializes the test class fixture. Finds surface, curve, and point properties defined in the application schema. Properties that use primitive types are preferred, but if none are defined then aggregate geometry types (Multi*) will be used instead.
    • joinWithIntersects

      public void joinWithIntersects()
      [Test] Submits a basic join query that includes the Intersects operator. A projection clause (wfs:PropertyName) is omitted, so the response entity is expected to contain instances of both feature types.
    • selfJoinWithIntersects

      public void selfJoinWithIntersects()