Package org.locationtech.jts.operation
Class BoundaryOp
java.lang.Object
org.locationtech.jts.operation.BoundaryOp
Computes the boundary of a
Geometry
.
Allows specifying the BoundaryNodeRule
to be used.
This operation will always return a Geometry
of the appropriate
dimension for the boundary (even if the input geometry is empty).
The boundary of zero-dimensional geometries (Points) is
always the empty GeometryCollection
.- Version:
- 1.7
- Author:
- Martin Davis
-
Constructor Summary
ConstructorsConstructorDescriptionBoundaryOp
(Geometry geom) Creates a new instance for the given geometry.BoundaryOp
(Geometry geom, BoundaryNodeRule bnRule) Creates a new instance for the given geometry. -
Method Summary
Modifier and TypeMethodDescriptionGets the computed boundary.static Geometry
Computes a geometry representing the boundary of a geometry.static Geometry
getBoundary
(Geometry g, BoundaryNodeRule bnRule) Computes a geometry representing the boundary of a geometry, using an explicitBoundaryNodeRule
.static boolean
hasBoundary
(Geometry geom, BoundaryNodeRule boundaryNodeRule) Tests if a geometry has a boundary (it is non-empty).
-
Constructor Details
-
BoundaryOp
Creates a new instance for the given geometry.- Parameters:
geom
- the input geometry
-
BoundaryOp
Creates a new instance for the given geometry.- Parameters:
geom
- the input geometrybnRule
- the Boundary Node Rule to use
-
-
Method Details
-
getBoundary
Computes a geometry representing the boundary of a geometry.- Parameters:
g
- the input geometry- Returns:
- the computed boundary
-
getBoundary
Computes a geometry representing the boundary of a geometry, using an explicitBoundaryNodeRule
.- Parameters:
g
- the input geometrybnRule
- the Boundary Node Rule to use- Returns:
- the computed boundary
-
hasBoundary
Tests if a geometry has a boundary (it is non-empty). The semantics are:- Empty geometries do not have boundaries.
- Points do not have boundaries.
- For linear geometries the existence of the boundary
is determined by the
BoundaryNodeRule
. - Non-empty polygons always have a boundary.
- Parameters:
geom
- the geometry providing the boundaryboundaryNodeRule
- the Boundary Node Rule to use- Returns:
- true if the boundary exists
-
getBoundary
Gets the computed boundary.- Returns:
- the boundary geometry
-