Polygonizes a set of
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:
Dangles - edges which have one or both ends which are not incident on another edge endpoint
Cut Edges - edges which are connected at both ends but which do not form part of polygon
Invalid Ring Lines - edges which form rings which are invalid (e.g. the component lines contain a self-intersection)
The
Polygonizer(boolean) constructor allows extracting only polygons which form a valid polygonal result. The set of extracted polygons is guaranteed to be edge-disjoint. This is useful where it is known that the input lines form a valid polygonal geometry (which may include holes or nested polygons).
Other
version: 1.7
public Polygonizer()
Creates a polygonizer that extracts all polygons.
public Polygonizer(boolean extractOnlyPolygonal)
Creates a polygonizer, specifying whether a valid polygonal geometry must be created. If the argument is
true then areas may be discarded in order to ensure that the extracted geometry is a valid polygonal geometry.
Parameters:
extractOnlyPolygonal - extractOnlyPolygonal true if a valid polygonal geometry should be extracted
Adds a collection of geometries 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.
Parameters:
geomList - geomList a list of
Geometrys with linework to be polygonized
Add a
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
Gets a geometry representing the polygons formed by the polygonization. If a valid polygonal geometry was extracted the result is a
Polygonal geometry.