Class S104CoverageStyle
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.
- Station: a 16 px rounded square with a chevron up (rising), chevron down (falling), dash (steady) or "?" (unknown), and the height at the selected step to its right (FormatStationValue(double)), shown at 1:StationLabelMaxScaleDenominator and larger scales. They are ordinary S-100 symbols (Symbols) and text (built with StationSymbols and StationLabels), so they follow the same rules as S-101 symbols and labels: symbol and text scale, scale minimum, label declutter, and upright drawing on a rotated display.
- Surface: dashed isolines every IsolineInterval m, or FineIsolineInterval m when the dataset's whole range is under FineIntervalRangeLimit m (SelectIsolineInterval(double, double)), labelled with FormatIsolineLabel(double, double).
Fields
FallingSymbol
Station symbol for a falling water level.
public const string FallingSymbol = "S104GAUGE_FALLING"
Field Value
FineIntervalRangeLimit
The dataset range, in metres, under which FineIsolineInterval is used.
public const double FineIntervalRangeLimit = 1
Field Value
FineIsolineInterval
The isoline interval for a dataset with a small range, in metres.
public const double FineIsolineInterval = 0.25
Field Value
InkToken
Colour token of the ink (stroke, mark, label; isoline lines and labels) in Palette.
public const string InkToken = "S104INK"
Field Value
IsolineInterval
The isoline interval, in metres.
public const double IsolineInterval = 0.5
Field Value
IsolineLabelHaloToken
Colour token of the isoline label halo in Palette: the palette's water ground.
public const string IsolineLabelHaloToken = "S104ISOHALO"
Field Value
LabelHaloToken
Colour token of the station label halo in Palette.
public const string LabelHaloToken = "S104HALO"
Field Value
NoDataSymbol
Station symbol for a time step with no value.
public const string NoDataSymbol = "S104GAUGE_NODATA"
Field Value
RisingSymbol
Station symbol for a rising water level.
public const string RisingSymbol = "S104GAUGE_RISING"
Field Value
StationLabelFontSize
Size of the station value label, in pixels (the text scale multiplies it).
public const double StationLabelFontSize = 11
Field Value
StationLabelHaloMm
Width of the halo under station labels, in millimetres (3 px).
public const double StationLabelHaloMm = 0.96
Field Value
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
StationLabelOffsetMm
Distance from the station to the label's left edge, in millimetres (13 px).
public const double StationLabelOffsetMm = 4.16
Field Value
SteadySymbol
Station symbol for a steady water level.
public const string SteadySymbol = "S104GAUGE_STEADY"
Field Value
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
SymbolFillToken
Colour token of the station square fill in Palette.
public const string SymbolFillToken = "S104FILL"
Field Value
UnknownSymbol
Station symbol for an unknown trend.
public const string UnknownSymbol = "S104GAUGE_UNKNOWN"
Field Value
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
ActivePaletteType
The palette last passed to SwitchPaletteAsync(PaletteType, CancellationToken); Day until then.
public PaletteType ActivePaletteType { get; }
Property Value
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
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
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
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
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
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
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
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
Returns
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
heightdoubleThe height in metres.
Returns
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
minimumdoubleThe lowest value.
maximumdoubleThe highest value.
intervaldoubleThe interval, greater than zero.
Returns
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
settingsMarinerSettingsUnused.
Returns
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
Returns
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
typePaletteTypeThe palette mood (Day, Dusk, or Night).
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
When the style has no palette for type,
implementations keep a usable palette active (the current one, or
Day) rather than failing.