Class: IsValidOp

jsts.operation.valid.IsValidOp

new IsValidOp()

Implements the algorithms required to compute the isValid() method for Geometrys. See the documentation for the various geometry types for a specification of validity.
Version:
  • 1.7
Source:

Methods

(static) findPtNotNode()

Find a point from the list of testCoords that is NOT a node in the edge for the list of searchCoords
Source:
Returns:
the point found, or null if none found.

(static) isValid(geom)

Tests whether a Geometry is valid.
Parameters:
Name Type Description
geom the Geometry to test.
Source:
Returns:
true if the geometry is valid.

checkConsistentArea(graph)

Checks that the arrangement of edges in a polygonal geometry graph forms a consistent area.
Parameters:
Name Type Description
graph
Source:
See:
  • ConsistentAreaTester

checkHolesInShell(p, graph)

Tests that each hole is inside the polygon shell. This routine assumes that the holes have previously been tested to ensure that all vertices lie on the shell oon the same side of it (i.e that the hole rings do not cross the shell ring). In other words, this test is only correct if the ConsistentArea test is passed first. Given this, a simple point-in-polygon test of a single point in the hole can be used, provided the point is chosen such that it does not lie on the shell.
Parameters:
Name Type Description
p the polygon to be tested for hole inclusion.
graph a GeometryGraph incorporating the polygon.
Source:

checkHolesNotNested()

Tests that no hole is nested inside another hole. This routine assumes that the holes are disjoint. To ensure this, holes have previously been tested to ensure that:
  • they do not partially overlap (checked by checkRelateConsistency)
  • they are not identical (checked by checkRelateConsistency)
Source:

checkNoSelfIntersectingRing()

Check that a ring does not self-intersect, except at its endpoints. Algorithm is to count the number of times each node along edge occurs. If any occur more than once, that must be a self-intersection.
Source:

checkNoSelfIntersectingRings(graph)

Check that there is no ring which self-intersects (except of course at its endpoints). This is required by OGC topology rules (but not by other models such as ESRI SDE, which allow inverted shells and exverted holes).
Parameters:
Name Type Description
graph the topology graph of the geometry.
Source:

checkShellInsideHole()

This routine checks to see if a shell is properly contained in a hole. It assumes that the edges of the shell and hole do not properly intersect.
Source:
Returns:
null if the shell is properly contained, or a Coordinate which is not inside the hole if it is not.

checkShellNotNested()

Check if a shell is incorrectly nested within a polygon. This is the case if the shell is inside the polygon shell, but not inside a polygon hole. (If the shell is inside a polygon hole, the nesting is valid.)

The algorithm used relies on the fact that the rings must be properly contained. E.g. they cannot partially overlap (this has been previously checked by checkRelateConsistency )

Source:

checkShellsNotNested()

Tests that no element polygon is wholly in the interior of another element polygon.

Preconditions:

  • shells do not partially overlap
  • shells do not touch along an edge
  • no duplicate rings exist
This routine relies on the fact that while polygon shells may touch at one or more vertices, they cannot touch at ALL vertices.
Source:

checkValidLinearRing()

Checks validity of a LinearRing.
Source:

checkValidLineString()

Checks validity of a LineString. Almost anything goes for linestrings!
Source:

checkValidMultiPoint()

Checks validity of a MultiPoint.
Source:

checkValidPoint()

Checks validity of a Point.
Source:

checkValidPolygon()

Checks the validity of a polygon. Sets the validErr flag.
Source:

setSelfTouchingRingFormingHoleValid(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:
Name Type Description
isValid states whether geometry with this condition is valid.
Source: