Table of Contents

Class S104CoverageStyle

Namespace
EncDotNet.S100.Datasets.S104
Assembly
EncDotNet.S100.Datasets.S104.dll

The SoundCharts portrayal of S-104 water level: station gauges for fixed-station series (dcf1 / dcf8) and labelled isolines for gridded surfaces (dcf2), in one ink colour per Day / Dusk / Night palette.

public class S104CoverageStyle : ICoverageStyle
Inheritance
S104CoverageStyle
Implements
Inherited Members

Remarks

S-104 Ed 2.0.0 §9 defines no portrayal: the data exists to adjust depths in the ENC or bathymetry (S-98 Annex C), and the edition removed the earlier portrayal catalogue. Everything this style describes is SoundCharts' own symbology, and the viewer, CLI and MCP tools label it so (S100Products.S104Portrayal, the S-104 registration's Portrayal trait). It is defined in code, so it is an ICoverageStyle and not an IPortrayalCatalogue: it has no catalogue specification or edition. Replace it with an official IHO portrayal catalogue if one is published.

The design keeps clear of official portrayal: no colour fill over the ENC, and a desaturated teal ink because magenta (mariner information), red and amber (danger) and blue and green (depth) are already taken. Colour encodes neither trend nor height. Night stays under luminance 0.2.

Fields

FallingSymbol

Station symbol for a falling water level.

public const string FallingSymbol = "S104GAUGE_FALLING"

Field Value

string

FineIntervalRangeLimit

The dataset range, in metres, under which FineIsolineInterval is used.

public const double FineIntervalRangeLimit = 1

Field Value

double

FineIsolineInterval

The isoline interval for a dataset with a small range, in metres.

public const double FineIsolineInterval = 0.25

Field Value

double

InkToken

Colour token of the ink (stroke, mark, label; isoline lines and labels) in Palette.

public const string InkToken = "S104INK"

Field Value

string

IsolineInterval

The isoline interval, in metres.

public const double IsolineInterval = 0.5

Field Value

double

IsolineLabelHaloToken

Colour token of the isoline label halo in Palette: the palette's water ground.

public const string IsolineLabelHaloToken = "S104ISOHALO"

Field Value

string

LabelHaloToken

Colour token of the station label halo in Palette.

public const string LabelHaloToken = "S104HALO"

Field Value

string

NoDataSymbol

Station symbol for a time step with no value.

public const string NoDataSymbol = "S104GAUGE_NODATA"

Field Value

string

RisingSymbol

Station symbol for a rising water level.

public const string RisingSymbol = "S104GAUGE_RISING"

Field Value

string

StationLabelFontSize

Size of the station value label, in pixels (the text scale multiplies it).

public const double StationLabelFontSize = 11

Field Value

double

StationLabelHaloMm

Width of the halo under station labels, in millimetres (3 px).

public const double StationLabelHaloMm = 0.96

Field Value

double

StationLabelMaxScaleDenominator

The largest scale denominator the station value label is drawn at (1:100 000). At smaller scales only the square is drawn.

public const double StationLabelMaxScaleDenominator = 100000

Field Value

double

StationLabelOffsetMm

Distance from the station to the label's left edge, in millimetres (13 px).

public const double StationLabelOffsetMm = 4.16

Field Value

double

SteadySymbol

Station symbol for a steady water level.

public const string SteadySymbol = "S104GAUGE_STEADY"

Field Value

string

StyleVersion

The version of this style, folded into the tile disk-cache ContentScope. Bump it whenever the symbols, the palette or anything else that changes the drawn pixels without changing the drawing instructions changes, so warm tiles drawn with the old style are dropped.

public const int StyleVersion = 1

Field Value

int

SymbolFillToken

Colour token of the station square fill in Palette.

public const string SymbolFillToken = "S104FILL"

Field Value

string

UnknownSymbol

Station symbol for an unknown trend.

public const string UnknownSymbol = "S104GAUGE_UNKNOWN"

Field Value

string

Properties

ActivePalette

Gets the currently active colour palette: Palette's colours for the palette last passed to SwitchPaletteAsync(PaletteType, CancellationToken) (Day until then).

public ColorPalette ActivePalette { get; }

Property Value

ColorPalette

ActivePaletteType

The palette last passed to SwitchPaletteAsync(PaletteType, CancellationToken); Day until then.

public PaletteType ActivePaletteType { get; }

Property Value

PaletteType

ContentScope

The style's part of the tile disk-cache content scope: the style name and StyleVersion plus the toolkit version (For(string, int)). The processor prefixes the dataset's content hash.

public static string ContentScope { get; }

Property Value

string

Contours

Empty: S-104 isoline levels depend on each dataset's range, so they come from SelectIsolineInterval(double, double) and IsolineLevels(double, double, double).

public IReadOnlyList<ContourStyle> Contours { get; }

Property Value

IReadOnlyList<ContourStyle>

Palette

The S-104 colours: the InkToken, SymbolFillToken, LabelHaloToken and IsolineLabelHaloToken of each Day / Dusk / Night palette. The station gauges' drawing instructions and symbols resolve against its GetColorPalette(PaletteType).

public static ApplicationPalette Palette { get; }

Property Value

ApplicationPalette

StationLabelStyle

The station value label: bold monospaced InkToken text on a LabelHaloToken halo, left-aligned StationLabelOffsetMm right of the station.

public static TextInstructionStyle StationLabelStyle { get; }

Property Value

TextInstructionStyle

StationLabels

Builds the station value labels: as StationSymbols, drawn at 1:StationLabelMaxScaleDenominator and larger, as an S-101 label with SCAMIN is.

public static InstructionBuilder StationLabels { get; }

Property Value

InstructionBuilder

StationSymbols

Builds the station symbol instructions: viewing group 0, priority 0, under radar, at every scale. The sub-layer's plane places them among the other products.

public static InstructionBuilder StationSymbols { get; }

Property Value

InstructionBuilder

Symbols

The station symbols (RisingSymbol and the others), embedded from the project's Symbols folder. Colours are palette classes resolved against Palette.

public static SymbolSet Symbols { get; }

Property Value

SymbolSet

Remarks

S-100 SVG symbols, pivot at the origin, colours by palette class (sTOKEN stroke, fTOKEN fill). Coordinates are the design's pixels; the 18 px viewBox is sized in millimetres so the shared symbol rule (SVG millimetres at 96 DPI, times the S-100 symbol factor 0.6) draws one design pixel as one display pixel: 18 × 0.0254 / 96 × 1000 / 0.6 mm. The square is 16 px with a 1.6 px stroke; marks are 1.9 px strokes with round caps and joins.

Methods

FormatIsolineLabel(double, double)

Formats an isoline level: metres to one decimal place (two for the FineIsolineInterval), "−" (U+2212) for negatives, no "+", and a bare "0" for zero: 1.0, 0.5, 0, −0.5.

public static string FormatIsolineLabel(double level, double interval)

Parameters

level double

The level in metres.

interval double

The dataset's isoline interval.

Returns

string

FormatStationValue(double)

Formats a station's height for its value label: the sign always shown, two decimals, metres without a unit: +1.42, −0.12 (U+2212), +0.00.

public static string FormatStationValue(double height)

Parameters

height double

The height in metres.

Returns

string

IsolineLevels(double, double, double)

The multiples of interval from minimum to maximum, inclusive.

public static IReadOnlyList<double> IsolineLevels(double minimum, double maximum, double interval)

Parameters

minimum double

The lowest value.

maximum double

The highest value.

interval double

The interval, greater than zero.

Returns

IReadOnlyList<double>

ResolveColorScheme(MarinerSettings)

Returns null: the SoundCharts S-104 portrayal draws isolines and no colour fill, so the ENC depth and drying colours under the surface stay readable.

public CoverageColorScheme? ResolveColorScheme(MarinerSettings settings)

Parameters

settings MarinerSettings

Unused.

Returns

CoverageColorScheme

SelectIsolineInterval(double, double)

The isoline interval for a dataset whose values over all time steps run from minimum to maximum metres (fill values excluded). Chosen once per dataset so the lines keep their density while the time step changes.

public static double SelectIsolineInterval(double minimum, double maximum)

Parameters

minimum double

The dataset's lowest value.

maximum double

The dataset's highest value.

Returns

double

SwitchPaletteAsync(PaletteType, CancellationToken)

Switches the active colour palette to type and pre-loads the assets the synchronous resolve methods need.

public ValueTask SwitchPaletteAsync(PaletteType type, CancellationToken cancellationToken = default)

Parameters

type PaletteType

The palette mood (Day, Dusk, or Night).

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

Remarks

When the style has no palette for type, implementations keep a usable palette active (the current one, or Day) rather than failing.