Table of Contents

Class WaterLevelDepthAdjustment

Namespace
EncDotNet.S100.Datasets.Pipelines.Navigation
Assembly
EncDotNet.S100.Datasets.Pipelines.dll

Chart-wide water level adjustment over an IWaterLevelField: the S-104 water level the route check and the pick report read, applied to the charted depths the S-101 and S-102 processors portray.

public sealed class WaterLevelDepthAdjustment : IDepthAdjustment
Inheritance
WaterLevelDepthAdjustment
Implements
Inherited Members

Remarks

The datum rule follows docs/design/chart-wide-water-level-adjustment.md §2.3 and §11 Q2. A water level on the same datum as the depth is applied, and one on a different datum is always refused. When either datum isn't declared (Unknown), the water level is applied only if ApplyUndeclaredDatum is set, which is the mariner's "Apply anyway when datum is not declared" override.

Instances are immutable and safe to share between render threads.

Constructors

WaterLevelDepthAdjustment(IWaterLevelField, bool, string)

Creates the adjustment.

public WaterLevelDepthAdjustment(IWaterLevelField field, bool applyUndeclaredDatum, string sourceKey)

Parameters

field IWaterLevelField

The water level to apply.

applyUndeclaredDatum bool

Whether to apply water level where either datum isn't declared.

sourceKey string

Identifies the water-level data the field was built from (for example a catalog snapshot), for Key.

Properties

ApplyUndeclaredDatum

Whether water level is applied where either datum isn't declared.

public bool ApplyUndeclaredDatum { get; }

Property Value

bool

Field

The field this adjustment applies.

public IWaterLevelField Field { get; }

Property Value

IWaterLevelField

Footprint

Where a water level is available, before any datum check: the area whose edge the chart draws as the adjusted-area boundary.

public IReadOnlyList<CoverageArea> Footprint { get; }

Property Value

IReadOnlyList<CoverageArea>

Key

What this adjustment applies (its sources, time or period, and datum policy), as a string. Two adjustments with the same key give the same result at every point, so it's safe to use in a memory cache key. It isn't stable across processes and shouldn't go into a disk cache.

public string Key { get; }

Property Value

string

Methods

Accepts(int?)

Whether a charted depth on depthDatum can be adjusted at all: the datum check alone, without a position.

public bool Accepts(int? depthDatum)

Parameters

depthDatum int?

The S-100 vertical datum code of the charted depth, or null.

Returns

bool

false when every water level is refused for that datum.

At(double, double, int?)

The water level to add to a charted depth on depthDatum at a point, or null where none applies: outside the footprint or the data's time range, or on a vertical datum the adjustment refuses.

public DepthAdjustmentSample? At(double latitude, double longitude, int? depthDatum)

Parameters

latitude double

Latitude in decimal degrees (WGS-84).

longitude double

Longitude in decimal degrees (WGS-84).

depthDatum int?

The S-100 vertical datum code of the charted depth, or null when it isn't declared.

Returns

DepthAdjustmentSample?

The water level to add, or null.

Permits(DatumAgreement)

Whether a datum agreement lets the water level apply under this adjustment's rule.

public bool Permits(DatumAgreement agreement)

Parameters

agreement DatumAgreement

The agreement between the depth's datum and the water level's.

Returns

bool

true when it applies.

Resolve(GeoPosition, int?)

The field's answer at a point with this adjustment's datum rule applied: an applied water level on an undeclared datum without the override comes back as DatumMismatch, the same status a different datum gets.

public WaterLevelAtPoint Resolve(GeoPosition position, int? depthDatum)

Parameters

position GeoPosition

The point.

depthDatum int?

The charted depth's datum code, or null.

Returns

WaterLevelAtPoint

The water level at the point and why it does or doesn't apply.