Class IsValidOp
java.lang.Object
org.locationtech.jts.operation.valid.IsValidOp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinatefindPtNotNode(Coordinate[] testCoords, LinearRing searchRing, GeometryGraph graph) Find a point from the list of testCoords that is NOT a node in the edge for the list of searchCoordsComputes the validity of the geometry, and if not valid returns the validation error for the geometry, or null if the geometry is valid.booleanisValid()Computes the validity of the geometry, and returns true if it is valid.static booleanisValid(Coordinate coord) Checks whether a coordinate is valid for processing.static booleanTests whether aGeometryis valid.voidsetSelfTouchingRingFormingHoleValid(boolean isValid) Sets whether polygons using Self-Touching Rings to form holes are reported as valid.
-
Constructor Details
-
IsValidOp
-
-
Method Details
-
isValid
-
isValid
Checks whether a coordinate is valid for processing. Coordinates are valid iff their x and y ordinates are in the range of the floating point representation.- Parameters:
coord- the coordinate to validate- Returns:
trueif the coordinate is valid
-
findPtNotNode
public static Coordinate findPtNotNode(Coordinate[] testCoords, LinearRing searchRing, GeometryGraph graph) Find a point from the list of testCoords that is NOT a node in the edge for the list of searchCoords- Returns:
- the point found, or
nullif none found
-
setSelfTouchingRingFormingHoleValid
public void setSelfTouchingRingFormingHoleValid(boolean isValid) Sets whether polygons using Self-Touching Rings to form holes are reported as valid. If this flag is set, the following Self-Touching conditions are treated as being valid:- the shell ring self-touches to create a hole touching the shell
- a hole ring self-touches to create two holes touching at a point
The default (following the OGC SFS standard) is that this condition is not valid (
false).This does not affect whether Self-Touching Rings disconnecting the polygon interior are considered valid (these are considered to be invalid under the SFS, and many other spatial models as well). This includes "bow-tie" shells, which self-touch at a single point causing the interior to be disconnected, and "C-shaped" holes which self-touch at a single point causing an island to be formed.
- Parameters:
isValid- states whether geometry with this condition is valid
-
isValid
public boolean isValid()Computes the validity of the geometry, and returns true if it is valid.- Returns:
- true if the geometry is valid
-
getValidationError
Computes the validity of the geometry, and if not valid returns the validation error for the geometry, or null if the geometry is valid.- Returns:
- the validation error, if the geometry is invalid or null if the geometry is valid
-