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

# Class BBOXTests

java.lang.Object
org.opengis.cite.iso19142.BaseFixture
org.opengis.cite.iso19142.basic.filter.QueryFilterFixture
org.opengis.cite.iso19142.basic.filter.spatial.BBOXTests

public class BBOXTests extends QueryFilterFixture
Tests the response to a GetFeature request that includes a BBOX predicate. All conforming "Basic WFS" implementations must support this spatial operator.

Sources

- OGC 09-025r2, Table 1: Conformance classes
- OGC 09-026r2, cl. A.7: Test cases for minimum spatial filter

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final double`
  `ENVELOPE_EXPANSION`

  ### 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
  `BBOXTests()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `(package private) void`
  `addBBOXPredicate(Document request, Element envelope, Element valueRef)`
  Adds a BBOX spatial predicate to a GetFeature request entity.
  `void`
  `bboxWithDefaultExtent(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a GetFeature request with a BBOX predicate referring to a valid geometry property.
  `void`
  `createGeometryBaseType()`
  Creates an XSTypeDefinition object representing the gml:AbstractGeometryType definition.
  `Document`
  `envelopeAsGML(org.opengis.geometry.Envelope extent)`
  Work around for Extents`envelopeAsGML(Envelope)` only using 2 decimals
  `void`
  `invalidGeometryOperand(QName featureType)`
  [`Test`] Submits a GetFeature request where the BBOX predicate refers to a feature property (gml:description) that is not geometry-valued.
  `void`
  `nonSpecificBBOX(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a GetFeature request with a non-specific BBOX predicate.
  `(package private) Element`
  `surfaceToPolygon(Element geometry)`
  Replaces gml:Surface elements having a single gml:PolygonPatch with a gml:Polygon element.

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

  - ### ENVELOPE_EXPANSION

    public static final double ENVELOPE_EXPANSION
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### BBOXTests

    public BBOXTests()

- ## Method Details

  - ### createGeometryBaseType

    @BeforeClass public void createGeometryBaseType()
    Creates an XSTypeDefinition object representing the gml:AbstractGeometryType definition.

  - ### nonSpecificBBOX

    public void nonSpecificBBOX(ProtocolBinding binding, QName featureType)
    [`Test`] Submits a GetFeature request with a non-specific BBOX predicate. If no value reference is specified the predicate is applied to all spatial properties. The response entity (wfs:FeatureCollection) must be schema-valid and contain only instances of the requested type that satisfy the spatial predicate.
    Parameters:
      `binding` - The ProtocolBinding to use for this request.
      `featureType` - A QName representing the qualified name of some feature type.
    See Also:
      - "ISO 19143:2010, 7.8.3.2: BBOX operator"

  - ### bboxWithDefaultExtent

    public void bboxWithDefaultExtent(ProtocolBinding binding, QName featureType)
    [`Test`] Submits a GetFeature request with a BBOX predicate referring to a valid geometry property. The response shall contain only features possessing a geometry value that spatially interacts (i.e. is not disjoint) with the given envelope.

    Sources

    - ISO 19143:2010, cl. A.7: Test cases for minimum spatial filter
    - ISO 19143:2010, 7.8.3.2: BBOX operator
    Parameters:
      `binding` - The ProtocolBinding to use for this request.
      `featureType` - A QName representing the qualified name of some feature type.

  - ### envelopeAsGML

    public Document envelopeAsGML(org.opengis.geometry.Envelope extent)
    Work around for Extents`envelopeAsGML(Envelope)` only using 2 decimals
    Parameters:
      `extent` - the envelope
    Returns:
      the envelope as GML

  - ### invalidGeometryOperand

    public void invalidGeometryOperand(QName featureType)
    [`Test`] Submits a GetFeature request where the BBOX predicate refers to a feature property (gml:description) that is not geometry-valued. An exception is expected in response with status code 400 and exception code `InvalidParameterValue`.
    Parameters:
      `featureType` - A QName representing the qualified name of a feature type for which instances exist.
    See Also:
      - "ISO 19142:2010, 11.4: GetFeature - Exceptions"
      - "ISO 19143:2010, 8.3: Exceptions"

  - ### surfaceToPolygon

    Element surfaceToPolygon(Element geometry)
    Replaces gml:Surface elements having a single gml:PolygonPatch with a gml:Polygon element. Such a simplification facilitates a binding to JTS geometry objects.
    Parameters:
      `geometry` - A GML geometry collection.
    Returns:
      A new DOM Element containing a simplified representation of the original geometry collection.
    See Also:
      - "ISO 19125-1: Geographic information -- Simple feature access -- Part 1: Common architecture"

  - ### addBBOXPredicate

    void addBBOXPredicate(Document request, Element envelope, Element valueRef)
    Adds a BBOX spatial predicate to a GetFeature request entity. If the envelope has no spatial reference (srsName) it is assumed to be the default CRS specified in the capabilities document.
    Parameters:
      `request` - The request entity (/wfs:GetFeature).
      `envelope` - A DOM Element representing a gml:Envelope.
      `valueRef` - An Element (fes:ValueReference) that specifies the spatial property to check. If it is `null`, the predicate applies to all spatial properties.