public class Polygonizer extends Object
Geometrys which contain linework that represents the edges of a planar graph. All types of Geometry are accepted as input; the constituent linework is extracted as the edges to be polygonized. The processed edges must be correctly noded; that is, they must only meet at their endpoints. Polygonization will accept incorrectly noded input but will not form polygons from non-noded edges, and reports them as errors.
The Polygonizer reports the follow kinds of errors:
| Modifier and Type | Field and Description |
|---|---|
protected List |
cutEdges
|
protected Collection |
dangles
|
protected com |
graph
|
protected List |
holeList
|
protected List |
invalidRingLines
|
protected List |
polyList
|
protected List |
shellList
|
| Constructor and Description |
|---|
Polygonizer()
Creates a polygonizer with the same
GeometryFactory as the input
Geometrys.
|
Polygonizer(boolean extractOnlyPolygonal)
Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Collection
Adds a collection of geometries to the edges to be polygonized.
|
void |
add(Geometry
Add a
Geometry to the edges to be polygonized.
|
Collection |
getCutEdges()
Gets the list of cut edges found during polygonization.
|
Collection |
getDangles()
Gets the list of dangling lines found during polygonization.
|
Geometry |
getGeometry()
Gets a geometry representing the polygons formed by the polygonization.
|
Collection |
getInvalidRingLines()
Gets the list of lines forming invalid rings found during polygonization.
|
Collection |
getPolygons()
Gets the list of polygons formed by the polygonization.
|
void |
setCheckRingsValid(boolean isCheckingRingsValid)
Allows disabling the valid ring checking, to optimize situations where invalid rings are not expected.
|
protected com.vividsolutions .jts .operation .polygonize .PolygonizeGraph graph
protected Collectiondangles
protected ListcutEdges
protected ListinvalidRingLines
protected ListholeList
protected ListshellList
protected ListpolyList
public Polygonizer()
GeometryFactory as the input
Geometrys. The output mask is
#ALL_POLYS.
public Polygonizer(boolean extractOnlyPolygonal)
extractOnlyPolygonal - true if only polygons which form a valid polygonal geometry are to be extracted
public void add(CollectiongeomList)
geomList - a list of
Geometrys with linework to be polygonized
public void add(Geometryg)
Geometry to the edges to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used
g - a
Geometry with linework to be polygonized
public void setCheckRingsValid(boolean isCheckingRingsValid)
The default is true
isCheckingRingsValid - true if generated rings should be checked for validity
public CollectiongetPolygons()
Polygons
public GeometrygetGeometry()
public CollectiongetDangles()
LineStrings which are dangles
public CollectiongetCutEdges()
LineStrings which are cut edges
public CollectiongetInvalidRingLines()
LineStrings which form invalid rings