Class GeometryAssert
java.lang.Object
org.opengis.cite.iso19136.data.spatial.GeometryAssert
Provides specialized assertion methods that apply to representations of geometry
objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
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.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.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
assertValidCRS
(Element geom) Asserts that the given geometry element has a valid CRS reference.static void
assertValidSurfaceBoundary
(Element surfaceElem) Asserts that the boundary of the given surface is topologically correct.(package private) static void
assertValidSurfaceOrientation
(Element surfaceElem) 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)
-
Method Details
-
assertValidCRS
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
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
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
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
Asserts that the boundary of the given surface is topologically correct. Each boundary component (curve) must be:- simple (does not self-intersect at points other than boundary points), and
- closed (forms a cycle).
- Parameters:
surfaceElem
- A DOM Element node representing a surface geometry (substitutes for gml:AbstractSurface).
-
assertValidSurfaceOrientation
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:- the exterior ring is oriented in a counter-clockwise (CCW) direction, and
- 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)
-