Class PointTests

java.lang.Object
org.opengis.cite.iso19136.data.DataFixture
org.opengis.cite.iso19136.data.spatial.PointTests

public class PointTests extends DataFixture
Validates the content of a gml:Point element (or any element in its substitution group), which implements the GM_Point class from ISO 19107. A point is defined by a single coordinate tuple.

Sources

  • ISO 19136:2007, cl. 10.3.1: PointType, Point
  • ISO 19107:2003, cl. 6.3.11: GM_Point
  • Field Details

  • Constructor Details

    • PointTests

      public PointTests()
  • Method Details

    • findPoints

      @BeforeClass public void findPoints()
      A configuration method (BeforeClass) that looks for gml:Point elements in the GML document under test. If none are found all test methods defined in the class will be skipped.
    • pointHasValidCRS

      public void pointHasValidCRS()
      [Test] Verifies that a gml:Point element has a valid CRS reference.

      Sources

      • ISO 19136, cl. 9.10, 10.1.3.2
      • ISO 19107, cl. 6.2.2.17 (Coordinate Reference System association)
    • pointHasValidPosition

      public void pointHasValidPosition()
      [Test] Verifies the coordinates of a gml:Point. All of the following constraints must be satisfied:
      1. length of coordinate tuple = CRS dimension;
      2. the point is located within the valid area of the CRS.

      Note that the last constraint will detect obvious cases where the axis order is incorrect (e.g. a position expressed in EPSG 4326 as -122.22, 50.55).

      Sources

      • ISO 19107:2003, cl. 6.2.2.10 (coordinateDimension)
    • createDirectPosition

      org.opengis.geometry.DirectPosition createDirectPosition(Element point, boolean ignoreThirdDimension)
      Creates a DirectPosition object from a gml:Point element. It will have the same CRS as the given point; the reference system may be inherited from a containing geometry (aggregate) or feature.
      Parameters:
      point - A gml:Point element (or an element in its substitution group).
      ignoreThirdDimension - If this flag is true then it will ignore third dimension else it will include all dimension.
      Returns:
      A DirectPosition holding the coordinates of the original point.
      Throws:
      IndexOutOfBoundsException - If the length of the coordinate tuple exceeds the dimension of the associated CRS.