Class Densifier
Densifies a geometry by inserting extra vertices along the line segments contained in the geometry. All segments in the created densified geometry will be no longer than the given distance tolerance (that is, all segments in the output will have length less than or equal to the distance tolerance).
Inherited Members
Namespace: NetTopologySuite.Densify
Assembly: NetTopologySuite.dll
Syntax
public class Densifier
Remarks
Densified polygonal geometries are guaranteed to be topologically correct.
The coordinates created during densification respect the input geometry's PrecisionModel. By default polygonal results are processed to ensure they are valid. This processing is costly, and it is very rare for results to be invalid. Validation processing can be disabled by setting the Validate property tofalse
.
Note: At some future point this class will offer a variety of densification strategies.
Constructors
| Edit this page View SourceDensifier(Geometry)
Creates a new densifier instance
Declaration
public Densifier(Geometry inputGeom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | inputGeom | The geometry to densify |
Properties
| Edit this page View SourceDistanceTolerance
Gets or sets the distance tolerance for the densification. All line segments in the densified geometry will be no longer than the distance tolerance. The distance tolerance must be positive.
Declaration
public double DistanceTolerance { get; set; }
Property Value
Type | Description |
---|---|
double |
Validate
Gets or sets whether polygonal results are processed to ensure they are valid.
Declaration
public bool Validate { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Methods
| Edit this page View SourceDensify(Geometry, double)
Densifies a geometry using a given distance tolerance, and respecting the input geometry's PrecisionModel.
Declaration
public static Geometry Densify(Geometry geom, double distanceTolerance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry densify |
double | distanceTolerance | The distance tolerance (DistanceTolerance) |
Returns
Type | Description |
---|---|
Geometry | The densified geometry |
GetResultGeometry()
Gets the densified geometry.
Declaration
public Geometry GetResultGeometry()
Returns
Type | Description |
---|---|
Geometry | The densified geometry |