public class PolygonHoleJoiner extends Object
There is no attempt to optimize the quality of the join lines. In particular, holes may be joined by lines longer than is optimal. However, holes which touch the shell or other holes are joined at the touch point.
The class does not require the input polygon to have normal orientation (shell CW and rings CCW). The output ring is always CW.
| Constructor and Description |
|---|
PolygonHoleJoiner(Polygon polygon)
Creates a new hole joiner.
|
| Modifier and Type | Method and Description |
|---|---|
Coordinate[] |
compute()
Computes the joined ring.
|
static Coordinate[] |
join(Polygon polygon)
Joins the shell and holes of a polygon
and returns the result as sequence of Coordinates.
|
static Polygon |
joinAsPolygon(Polygon polygon)
Joins the shell and holes of a polygon
and returns the result as an (invalid) Polygon.
|
public PolygonHoleJoiner(Polygon polygon)
polygon - the polygon to joinpublic static Polygon joinAsPolygon(Polygon polygon)
inputPolygon - the polygon to joinpublic static Coordinate[] join(Polygon polygon)
inputPolygon - the polygon to joinpublic Coordinate[] compute()
Copyright © 2024. All rights reserved.