public class IsSimpleOp extends Object
Geometry is simple.
In general, the SFS specification of simplicity
follows the rule:
Simplicity is defined for each Geometry type as follows:
isSimple trivially 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,
use Geometry.isValid()).
Geometry.touches(Geometry)
predicate.
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.BoundaryNodeRule| Constructor and Description |
|---|
IsSimpleOp(Geometry geometry)
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule
|
IsSimpleOp(Geometry geometry,
boolean shortCircuit) |
| Modifier and Type | Method and Description |
|---|---|
List<GeometryValidationError> |
getErrors() |
Point |
getNonSimpleLocation()
Gets a coordinate for the location where the geometry
fails to be simple.
|
boolean |
isSimple()
Tests whether the geometry is simple.
|
public IsSimpleOp(Geometry geometry)
geometry - the geometry to testpublic IsSimpleOp(Geometry geometry, boolean shortCircuit)
public List<GeometryValidationError> getErrors()
public Point getNonSimpleLocation()
isSimple() must be called before this method is called.public boolean isSimple()
Copyright © 2015 Revolution Systems Inc.. All rights reserved.