Package org.opengis.cite.iso19142.basic.filter.spatial

# Class IntersectsTests

java.lang.Object
org.opengis.cite.iso19142.BaseFixture
org.opengis.cite.iso19142.basic.filter.QueryFilterFixture
org.opengis.cite.iso19142.basic.filter.spatial.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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `IMPL_SPATIAL_FILTER`

  ### Fields inherited from class org.opengis.cite.iso19142.basic.filter.QueryFilterFixture

  `dataSampler, GET_FEATURE_MINIMAL, model, temporalProperties`

  ### Fields inherited from class org.opengis.cite.iso19142.BaseFixture

  `docBuilder, ETS_PKG, featureInfo, featureTypes, reqEntity, rspEntity, supportedBindings, TNS_PREFIX, wfsClient, wfsMetadata, wfsVersion`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IntersectsTests()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `(package private) void`
  `addSpatialPredicate(Document request, String spatialOp, Element gmlGeom, Element valueRef)`
  Adds a spatial predicate to a GetFeature request entity.
  `(package private) 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.
  `void`
  `findAllGeometryProperties()`
  Finds the geometry properties for all feature types recognized by the SUT.
  `void`
  `implementsIntersectsOp()`
  Checks if the spatial operator "Intersects" is implemented and which geometry operands are supported.
  `void`
  `implementsSpatialFilter(org.testng.ITestContext testContext)`
  Checks the value of the filter constraint "ImplementsSpatialFilter" in the capabilities document.
  `void`
  `intersectsCurve(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a GetFeature request containing an Intersects predicate with a gml:LineString or gml:Curve (LineStringSegment) operand.
  `void`
  `intersectsPolygon(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a GetFeature request containing an Intersects predicate with a gml:Polygon operand.

  ### Methods inherited from class org.opengis.cite.iso19142.basic.filter.QueryFilterFixture

  `buildRequestEntity, discardResponseEntity, findTemporalProperties, getModel, initQueryFilterFixture`

  ### Methods inherited from class org.opengis.cite.iso19142.BaseFixture

  `addAttributesOnTestFailure, allProtocolsAndFeatureTypes, bindingAndAvailFeatureTypeProductSet, extractBodyAsDocument, getFeatureTypes, getInstantiatedFeatureTypes, getProtocolBindings, initBaseFixture, initParser, setWfsClient`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### IMPL_SPATIAL_FILTER

    public static final String IMPL_SPATIAL_FILTER
    See Also:
      - Constant Field Values

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