Class IsSimpleOp
java.lang.Object
org.locationtech.jts.operation.IsSimpleOp
Deprecated.
Replaced by org.locationtech.jts.operation.valid.IsSimpleOp
Tests whether a
Geometry is simple.
In general, the SFS specification of simplicity
follows the rule:
- A Geometry is simple if and only if the only self-intersections are at boundary points.
Simplicity is defined for each Geometry type as follows:
- Polygonal geometries are simple by definition, so
isSimpletrivially returns true. (Note: this means that isSimple cannot be used to test for (invalid) self-intersections in Polygons. In order to check if a Polygonal geometry has self-intersections, useGeometry.isValid()). - Linear geometries are simple if they do not self-intersect at interior points
(i.e. points other than boundary points).
This is equivalent to saying that no two linear components satisfy the SFS
Geometry.touches(Geometry)predicate. - Zero-dimensional (point) geometries are simple if and only if they have no repeated points.
- Empty geometries are always simple, by definition
Lineal geometries the evaluation of simplicity
can be customized by supplying a BoundaryNodeRule
to define how boundary points are determined.
The default is the SFS-standard BoundaryNodeRule.MOD2_BOUNDARY_RULE.
Note that under the Mod-2 rule, closed LineStrings (rings)
will never satisfy the touches predicate at their endpoints, since these are
interior points, not boundary points.
If it is required to test whether a set of LineStrings touch
only at their endpoints, use IsSimpleOp with BoundaryNodeRule.ENDPOINT_BOUNDARY_RULE.
For example, this can be used to validate that a set of lines form a topologically valid
linear network.- Version:
- 1.7
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.use IsSimpleOp(Geometry)IsSimpleOp(Geometry geom) Deprecated.Creates a simplicity checker using the default SFS Mod-2 Boundary Node RuleIsSimpleOp(Geometry geom, BoundaryNodeRule boundaryNodeRule) Deprecated.Creates a simplicity checker using a givenBoundaryNodeRule -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets a coordinate for the location where the geometry fails to be simple.booleanisSimple()Deprecated.Tests whether the geometry is simple.booleanisSimple(LineString geom) Deprecated.use isSimple()booleanisSimple(MultiLineString geom) Deprecated.use isSimple()booleanisSimple(MultiPoint mp) Deprecated.use isSimple()
-
Constructor Details
-
IsSimpleOp
public IsSimpleOp()Deprecated.use IsSimpleOp(Geometry)Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule -
IsSimpleOp
Deprecated.Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule- Parameters:
geom- the geometry to test
-
IsSimpleOp
Deprecated.Creates a simplicity checker using a givenBoundaryNodeRule- Parameters:
geom- the geometry to testboundaryNodeRule- the rule to use.
-
-
Method Details
-
isSimple
public boolean isSimple()Deprecated.Tests whether the geometry is simple.- Returns:
- true if the geometry is simple
-
getNonSimpleLocation
Deprecated.Gets a coordinate for the location where the geometry fails to be simple. (i.e. where it has a non-boundary self-intersection).isSimple()must be called before this method is called.- Returns:
- a coordinate for the location of the non-boundary self-intersection or null if the geometry is simple
-
isSimple
Deprecated.use isSimple()Reports whether aLineStringis simple.- Parameters:
geom- the lineal geometry to test- Returns:
- true if the geometry is simple
-
isSimple
Deprecated.use isSimple()Reports whether aMultiLineStringgeometry is simple.- Parameters:
geom- the lineal geometry to test- Returns:
- true if the geometry is simple
-
isSimple
Deprecated.use isSimple()A MultiPoint is simple if it has no repeated points
-