Class GeometryAssert

java.lang.Object
org.opengis.cite.iso19136.data.spatial.GeometryAssert

public class GeometryAssert extends Object
Provides specialized assertion methods that apply to representations of geometry objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Asserts that the number of direct positions in the posList element appearing within each segment of the given curve geometry satisfies the minimum length requirements.
    static void
    assertCoordinateEquals(org.locationtech.jts.geom.Coordinate actualPos, org.locationtech.jts.geom.Coordinate expectedPos, int tolerancePPM, String message)
    Asserts that the given Coordinate tuples are equal within the specified tolerance.
    static void
    Asserts that the components of a composite curve are connected; that is, the orientation of the curve members is such that each component (except the first) begins where the preceding one ends.
    static void
    Asserts that all segments of a curve are connected; that is, the end point of each segment (except the last) is identical to the start point of the next segment.
    static void
    assertGeometryCoveredByValidArea(org.geotoolkit.gml.xml.v321.AbstractGeometryType gmlGeom)
    Asserts that the given geometry element is covered by the valid area of its associated CRS.
    static void
    Asserts that the given geometry element has a valid CRS reference.
    static void
    Asserts that the boundary of the given surface is topologically correct.
    (package private) static void
    Asserts that the boundary of the given surface is correctly oriented with respect to the upward normal.
    (package private) static void
    removeConsecutiveDuplicates(List<org.locationtech.jts.geom.Coordinate> coordList, double tolerancePPM)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • assertValidCRS

      public static void assertValidCRS(Element geom)
      Asserts that the given geometry element has a valid CRS reference. The value of the srsName attribute is an absolute URI that either identifies a "well-known" CRS definition or refers to a CRS definition. The reference may be inherited from a containing geometry (aggregate) or feature envelope.
      Parameters:
      geom - A DOM Element node representing a GML geometry element (or an element that can be substituted for one).
      See Also:
      • "ISO 19136: cl. 9.10, 10.1.3.2"
    • assertGeometryCoveredByValidArea

      public static void assertGeometryCoveredByValidArea(org.geotoolkit.gml.xml.v321.AbstractGeometryType gmlGeom)
      Asserts that the given geometry element is covered by the valid area of its associated CRS.

      WARNING: May be problematic for 3D coordinates.

      Parameters:
      gmlGeom - A GML geometry element.
    • assertAllCurveSegmentsHaveRequiredLength

      public static void assertAllCurveSegmentsHaveRequiredLength(Element gmlCurve)
      Asserts that the number of direct positions in the posList element appearing within each segment of the given curve geometry satisfies the minimum length requirements. The number of entries in a posList element is equal to the product of the dimensionality of the CRS and the number of direct positions. An additional check ensures that the number of entries is consistent with the CRS even if the minimum length constraint is satisfied; that is, size(posList) % dimCRS = 0.
      Parameters:
      gmlCurve - An Element node representing a GML curve geometry (gml:Curve or gml:LineString)
    • assertCurveSegmentsAreConnected

      public static void assertCurveSegmentsAreConnected(Element gmlCurve)
      Asserts that all segments of a curve are connected; that is, the end point of each segment (except the last) is identical to the start point of the next segment.
      Parameters:
      gmlCurve - An Element node representing a gml:Curve element.
    • assertCurveComponentsAreConnected

      public static void assertCurveComponentsAreConnected(Element gmlCurve)
      Asserts that the components of a composite curve are connected; that is, the orientation of the curve members is such that each component (except the first) begins where the preceding one ends.
      Parameters:
      gmlCurve - An Element node representing a gml:CompositeCurve element.
    • assertCoordinateEquals

      public static void assertCoordinateEquals(org.locationtech.jts.geom.Coordinate actualPos, org.locationtech.jts.geom.Coordinate expectedPos, int tolerancePPM, String message)
      Asserts that the given Coordinate tuples are equal within the specified tolerance.
      Parameters:
      actualPos - The actual position.
      expectedPos - The expected position.
      tolerancePPM - The maximum tolerable difference between tuple elements, expressed in parts per million (ppm).
      message - The assertion error message.
    • assertValidSurfaceBoundary

      public static void assertValidSurfaceBoundary(Element surfaceElem)
      Asserts that the boundary of the given surface is topologically correct. Each boundary component (curve) must be:
      1. simple (does not self-intersect at points other than boundary points), and
      2. closed (forms a cycle).
      Furthermore, each interior ring must be covered by the surface delimited by the exterior boundary (the rings may touch at a tangent point). Note: Surface patches based on parametric curves are not supported.
      Parameters:
      surfaceElem - A DOM Element node representing a surface geometry (substitutes for gml:AbstractSurface).
    • assertValidSurfaceOrientation

      static void assertValidSurfaceOrientation(Element surfaceElem)
      Asserts that the boundary of the given surface is correctly oriented with respect to the upward normal. In essence, the interior of the surface (patch) is always to the left of a boundary curve. The following constraints must be satisfied:
      1. the exterior ring is oriented in a counter-clockwise (CCW) direction, and
      2. all interior rings are oriented in a clockwise (CW) direction.
      Parameters:
      surfaceElem - A DOM Element node representing a surface geometry (substitutes for gml:AbstractSurface).
    • removeConsecutiveDuplicates

      static void removeConsecutiveDuplicates(List<org.locationtech.jts.geom.Coordinate> coordList, double tolerancePPM)