Class Polygonizer
Polygonizes a set of Geometrys which contain linework that represents the edges of a planar graph.
Inherited Members
Namespace: NetTopologySuite.Operation.Polygonize
Assembly: NetTopologySuite.dll
Syntax
public class Polygonizer
Remarks
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:
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 for situations where it is known that the input lines form a valid polygonal geometry (which may include holes or nested polygons).
Constructors
| Improve this Doc View SourcePolygonizer()
Creates a polygonizer that extracts all polygons.
Declaration
public Polygonizer()
Polygonizer(Boolean)
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.
Declaration
public Polygonizer(bool extractOnlyPolygonal)
Parameters
Type | Name | Description |
---|---|---|
Boolean | extractOnlyPolygonal |
|
Fields
| Improve this Doc View SourceAllPolys
The default polygonizer output behavior
Declaration
public const bool AllPolys = false
Field Value
Type | Description |
---|---|
Boolean |
Properties
| Improve this Doc View SourceIsCheckingRingsValid
Allows disabling the valid ring checking, to optimize situations where invalid rings are not expected.
Declaration
public bool IsCheckingRingsValid { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
The default is true
Methods
| Improve this Doc View SourceAdd(Geometry)
Adds a Geometry to the linework to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used
Declaration
public void Add(Geometry g)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | A |
Add(ICollection<Geometry>)
Adds a collection of Geometrys to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used.
Declaration
public void Add(ICollection<Geometry> geomList)
Parameters
Type | Name | Description |
---|---|---|
ICollection<Geometry> | geomList | A list of |
GetCutEdges()
Gets the list of cut edges found during polygonization.
Declaration
public ICollection<LineString> GetCutEdges()
Returns
Type | Description |
---|---|
ICollection<LineString> |
GetDangles()
Gets the list of dangling lines found during polygonization.
Declaration
public ICollection<LineString> GetDangles()
Returns
Type | Description |
---|---|
ICollection<LineString> |
GetGeometry()
Gets a geometry representing the polygons formed by the polygonization. If a valid polygonal geometry was extracted the result is a IPolygonal geometry.
Declaration
public Geometry GetGeometry()
Returns
Type | Description |
---|---|
Geometry | A geometry containing the polygons |
GetInvalidRingLines()
Gets the list of lines forming invalid rings found during polygonization.
Declaration
public IList<Geometry> GetInvalidRingLines()
Returns
Type | Description |
---|---|
IList<Geometry> |
GetPolygons()
Gets the list of polygons formed by the polygonization.
Declaration
public ICollection<Geometry> GetPolygons()
Returns
Type | Description |
---|---|
ICollection<Geometry> |