Table of Contents

Class S57ArcDensifier

Namespace
EncDotNet.S57
Assembly
EncDotNet.S57.dll

Turns S-57 arcs (AR2D) and elliptical arcs (EL2D) into polylines.

public static class S57ArcDensifier
Inheritance
S57ArcDensifier
Inherited Members

Remarks

Arcs are drawn clockwise about their centre, from the start point to the end point (S-57 Part 3, clause 5.1.4.4), with X as longitude (east) and Y as latitude (north). When the start and end points are the same, the arc is a full circle. The arc is interpolated in the coordinate plane of the data set, whatever its construction surface.

The polylines are in the data set's integer coordinate units: divide by the coordinate multiplication factor (COMF) to get decimal degrees. They start and end exactly on the arc's start and end points, and repeated points are dropped.

The curve types (B-splines and Bézier curves, with CT2D control points) aren't interpolated: their control points are joined by straight lines.

Fields

DefaultTolerance

The default tolerance, in decimal degrees: about a metre on the ground. It is the largest distance between a densified arc and the polyline that replaces it.

public const double DefaultTolerance = 1E-05

Field Value

double

MaximumSegmentCount

The most segments a single arc is divided into.

public const int MaximumSegmentCount = 4096

Field Value

int

Methods

Densify(S57Arc, double, int)

Densifies an arc into a polyline that is never further than a tolerance from the arc.

public static IReadOnlyList<S57Coordinate2D> Densify(S57Arc arc, double tolerance, int multiplicationFactor)

Parameters

arc S57Arc

The arc.

tolerance double

The largest distance between the arc and the polyline, in decimal degrees; see DefaultTolerance.

multiplicationFactor int

The coordinate multiplication factor (COMF) of the data set, which converts the tolerance to coordinate units.

Returns

IReadOnlyList<S57Coordinate2D>

The polyline, from the arc's start point to its end point.

Exceptions

ArgumentOutOfRangeException

tolerance isn't positive, or multiplicationFactor isn't positive.

Densify(S57Arc, int)

Densifies an arc into a polyline of a given number of segments.

public static IReadOnlyList<S57Coordinate2D> Densify(S57Arc arc, int segmentCount)

Parameters

arc S57Arc

The arc.

segmentCount int

The number of straight segments, from 1 to MaximumSegmentCount.

Returns

IReadOnlyList<S57Coordinate2D>

The polyline, from the arc's start point to its end point.

Exceptions

ArgumentOutOfRangeException

segmentCount is out of range.

Densify(S57ArcCurve, double, int)

Densifies the arcs, elliptical arcs and control points of an arc/curve definition into a single polyline, in that order.

public static IReadOnlyList<S57Coordinate2D> Densify(S57ArcCurve curve, double tolerance, int multiplicationFactor)

Parameters

curve S57ArcCurve

The arc/curve definition.

tolerance double

The largest distance between an arc and the polyline, in decimal degrees; see DefaultTolerance.

multiplicationFactor int

The coordinate multiplication factor (COMF) of the data set.

Returns

IReadOnlyList<S57Coordinate2D>

The polyline.

Exceptions

ArgumentNullException

curve is null.

ArgumentOutOfRangeException

tolerance isn't positive, or multiplicationFactor isn't positive.

Densify(S57EllipticalArc, double, int)

Densifies an elliptical arc into a polyline that is never further than about a tolerance from the arc.

public static IReadOnlyList<S57Coordinate2D> Densify(S57EllipticalArc arc, double tolerance, int multiplicationFactor)

Parameters

arc S57EllipticalArc

The elliptical arc.

tolerance double

The largest distance between the arc and the polyline, in decimal degrees; see DefaultTolerance. It is applied to the circle of the ellipse's major axis, which bounds the distance on the ellipse.

multiplicationFactor int

The coordinate multiplication factor (COMF) of the data set, which converts the tolerance to coordinate units.

Returns

IReadOnlyList<S57Coordinate2D>

The polyline, from the arc's start point to its end point.

Exceptions

ArgumentOutOfRangeException

tolerance isn't positive, or multiplicationFactor isn't positive.

Densify(S57EllipticalArc, int)

Densifies an elliptical arc into a polyline of a given number of segments.

public static IReadOnlyList<S57Coordinate2D> Densify(S57EllipticalArc arc, int segmentCount)

Parameters

arc S57EllipticalArc

The elliptical arc.

segmentCount int

The number of straight segments, from 1 to MaximumSegmentCount.

Returns

IReadOnlyList<S57Coordinate2D>

The polyline, from the arc's start point to its end point.

Exceptions

ArgumentOutOfRangeException

segmentCount is out of range.

Densify(IReadOnlyList<S57ArcCurve>, double, int)

Densifies a sequence of arc/curve definitions, such as those of an edge, into a single polyline.

public static IReadOnlyList<S57Coordinate2D> Densify(IReadOnlyList<S57ArcCurve> curves, double tolerance, int multiplicationFactor)

Parameters

curves IReadOnlyList<S57ArcCurve>

The arc/curve definitions, in order.

tolerance double

The largest distance between an arc and the polyline, in decimal degrees; see DefaultTolerance.

multiplicationFactor int

The coordinate multiplication factor (COMF) of the data set.

Returns

IReadOnlyList<S57Coordinate2D>

The polyline.

Exceptions

ArgumentNullException

curves is null.

ArgumentOutOfRangeException

tolerance isn't positive, or multiplicationFactor isn't positive.