Class IntersectsTests


public class IntersectsTests extends QueryFilterFixture
Tests the response to a GetFeature request that includes the spatial predicate Intersects. This predicate is the logical complement of the Disjoint predicate; that is:
 a.Intersects(b) ⇔ ! a.Disjoint(b)
 
See Also:
  • "OGC 09-026r2, A.8: Test cases for spatial filter"
  • "ISO 19125-1, 6.1.15.3"
  • Field Details

  • Constructor Details

    • IntersectsTests

      public IntersectsTests()
  • Method Details

    • implementsSpatialFilter

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

      @BeforeClass public void findAllGeometryProperties()
      Finds the geometry properties for all feature types recognized by the SUT.
    • implementsIntersectsOp

      @BeforeClass public void implementsIntersectsOp()
      Checks if the spatial operator "Intersects" is implemented and which geometry operands are supported. If it's not implemented, all tests for this operator are skipped.
    • intersectsPolygon

      public void intersectsPolygon(ProtocolBinding binding, QName featureType) throws XPathExpressionException
      [Test] Submits a GetFeature request containing an Intersects predicate with a gml:Polygon operand. The response entity must be schema-valid and contain only matching instances.
      Parameters:
      binding - The ProtocolBinding to use for this request.
      featureType - A QName representing the qualified name of some feature type.
      Throws:
      XPathExpressionException
    • intersectsCurve

      public void intersectsCurve(ProtocolBinding binding, QName featureType) throws XPathExpressionException
      [Test] Submits a GetFeature request containing an Intersects predicate with a gml:LineString or gml:Curve (LineStringSegment) operand. The response entity must be schema-valid and contain only matching instances.
      Parameters:
      binding - The ProtocolBinding to use for this request.
      featureType - A QName representing the qualified name of some feature type.
      Throws:
      XPathExpressionException
    • buildGetFeatureRequest

      Document buildGetFeatureRequest(QName featureType, String operator, org.apache.xerces.xs.XSElementDeclaration propertyDecl, Element literal)
      Builds a simple GetFeature request entity that contains a basic filter expression.
      Parameters:
      featureType - The name of the feature type.
      operator - The name of the filter predicate (operator).
      propertyDecl - The declaration of the feature property to be queried.
      literal - An element representing the literal value to match.
      Returns:
      A Document containing a request entity with wfs:GetFeature as the document element.
    • addSpatialPredicate

      void addSpatialPredicate(Document request, String spatialOp, Element gmlGeom, Element valueRef)
      Adds a spatial predicate to a GetFeature request entity. If the given geometry element has no spatial reference (srsName) it is assumed to use the default CRS specified in the capabilities document.
      Parameters:
      request - The request entity (wfs:GetFeature).
      spatialOp - The name of a spatial operator.
      gmlGeom - A DOM Element representing a GML geometry.
      valueRef - An Element (fes:ValueReference) that specifies the spatial property to check. If it is null, the predicate applies to all spatial properties.