Table of Contents

Class MapsuiCoverageArrowRenderer

Namespace
EncDotNet.S100.Renderers.Mapsui
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

Renders oriented symbols (e.g. S-111 current arrows) from a StyledCoverageLayer as a ThinnedSymbolLayer: one vector Mapsui.Layers.PointFeature per grid cell that survives zoom-dependent thinning. Each feature carries a Mapsui Mapsui.Styles.ImageStyle that wraps the bundled SVG symbol via the "svg-content://" URI scheme so Mapsui re-rasterises the symbol at the active screen DPI on every viewport change.

public sealed class MapsuiCoverageArrowRenderer
Inheritance
MapsuiCoverageArrowRenderer
Inherited Members

Remarks

The layer creates its features lazily, while a frame is drawn, but Mapsui only loads the images whose Mapsui.Styles.Image exists when the map fetches data. So Render(StyledCoverageLayer) creates one Mapsui.Styles.Image per symbol the field uses up front, and every feature reuses it; otherwise a symbol first used after the last fetch (a stronger wind barb in a newly framed view, say) stays undrawn until the viewport changes.

Per-feature symbols keep arrows at a stable on-screen size and sharp at every zoom — S-111 Ed 2.0.0 §9.2.4 sizes arrows in millimetres on the display, not in ground units.

Per-band scaling follows the bundled portrayal catalogue (S-111 Ed 2.0.0, content/S111/pc/Rules/select_arrow.xsl): bands 1-3 share scaleFloor = 0.40, bands 4-8 use scaleFactorIntermediate = 0.20 multiplied by surfaceCurrentSpeed, and band 9 uses scaleCeiling = 2.60 — Eqn 9.1 with Href = 10 mm, Sref = 5 kn, Slow = 2 kn and Shigh = 13 kn. These per-band factors multiply BaseSymbolScale to produce the Mapsui Mapsui.Styles.BasePointStyle.SymbolScale.

Thinning is done per frame by the returned layer, for the resolution it is drawn at, with the S-98 Appendix G-1.1 grid algorithm (see ThinGrid(int, int, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<float>, ReadOnlySpan<float>, double, SymbolRect, double, List<int>)). The arrow length it spaces by is the scheme's NominalSymbolLengthMillimetres × band scale × BaseSymbolScale, converted at PixelsPerMillimetre.

Constructors

MapsuiCoverageArrowRenderer(ICrsTransformFactory)

Creates an arrow renderer that places symbols in Web Mercator.

public MapsuiCoverageArrowRenderer(ICrsTransformFactory transformFactory)

Parameters

transformFactory ICrsTransformFactory

Creates the transform from a coverage's native CRS to WGS84, which is then projected to Web Mercator.

Properties

BaseSymbolScale

Multiplier applied to each band's scale factor to produce the Mapsui Mapsui.Styles.BasePointStyle.SymbolScale. The bundled SCAROW SVGs declare width="6mm" height="11mm" with viewBox -3 -5.5 6 11; Mapsui rasterises them at roughly 23×42 pixels at 96 dpi when SymbolScale = 1.0. Callers (typically S111DatasetProcessor) should multiply the user-facing RenderContext.SymbolScale into this value so the Symbol Scale slider continues to affect arrow size. Thinning spaces arrows by their scaled size, so a larger symbol scale also draws fewer arrows.

public double BaseSymbolScale { get; set; }

Property Value

double

LayerName

Name assigned to the generated Mapsui layer.

public string LayerName { get; set; }

Property Value

string

Opacity

Layer opacity (0.0–1.0). Defaults to 1.0.

public double Opacity { get; set; }

Property Value

double

Palette

The colour palette used to resolve SVG CSS fill/stroke tokens (e.g. fSCBN1 → palette token SCBN1).

public ColorPalette? Palette { get; set; }

Property Value

ColorPalette

SymbolProvider

Returns raw SVG content for a symbol reference name (e.g. "SCAROW01").

public required Func<string, string?> SymbolProvider { get; set; }

Property Value

Func<string, string>

Methods

Render(StyledCoverageLayer)

Renders the layer's symbol scheme as a ThinnedSymbolLayer of rotated, palette-coloured Mapsui.Layers.PointFeatures, one per grid cell with data. Returns null when the layer has no symbol scheme.

public ILayer? Render(StyledCoverageLayer layer)

Parameters

layer StyledCoverageLayer

The styled coverage layer carrying the symbol scheme.

Returns

ILayer