Table of Contents

Class MapsuiDisplayListRenderer

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

Renders an S-100 Part 9 drawing-instruction display list into a Mapsui Mapsui.Layers.ILayer by resolving feature geometry from an IFeatureGeometryProvider, projecting to EPSG:3857, and applying styles derived from the instruction properties.

public sealed class MapsuiDisplayListRenderer
Inheritance
MapsuiDisplayListRenderer
Inherited Members

Remarks

This renderer is product-agnostic: it consumes the unified DrawingInstruction model (produced by S-101 Lua, S-124/S-129/S-421 XSLT, or other portrayal pipelines) and a geometry provider that knows how to look up feature geometry for the current product.

Fields

DenomToResolutionMetres

S-100 Part 9 scale denominator → ground metres per display pixel at 96 DPI: 1 px = 0.28 mm = 0.00028 m on the nominal display surface, so ground resolution ≈ scaleDenominator × 0.00028. To obtain the Mapsui EPSG:3857 resolution (metres/pixel at the equator) this must be divided by cos(latitude) to undo web-mercator scale distortion — see DenominatorToResolution(double, double).

public const double DenomToResolutionMetres = 0.00028

Field Value

double

FeatureRefKey

Key used to store the originating S-100 feature reference on Mapsui features. Consumers can read feature[FeatureRefKey] to trace a rendered feature back to its source dataset record.

public const string FeatureRefKey = "S100.FeatureRef"

Field Value

string

Properties

AreaFillProvider

Optional function that returns an AreaFill definition by name. When set, non-colorFill area instructions will render using tiled SVG patterns.

public Func<string, AreaFill?>? AreaFillProvider { get; set; }

Property Value

Func<string, AreaFill>

AssetCache

Optional shared cache for processed-SVG symbol entries and rasterised pattern tiles. When set, the renderer routes its symbol/pattern lookups through this cache so re-renders of the same dataset (e.g. after a palette toggle, time-step scrub, or mariner-setting change) reuse the SVG processing + pattern rasterization work. When unset (the default), a per-renderer cache is used, preserving legacy behaviour for ad-hoc / one-shot callers such as tests.

public MapsuiRenderAssetCache? AssetCache { get; set; }

Property Value

MapsuiRenderAssetCache

ContentScope

Content identity of the dataset this layer portrays (see ContentScope), folded into the warm tile disk-cache namespace. The style-state hash covers the drawing instructions but not the geometry they draw, so without it two same-shaped datasets of one product, or a re-issued dataset whose geometry moved, would be served each other's tiles. When null, the layer bypasses the disk cache.

public string? ContentScope { get; set; }

Property Value

string

LayerName

Name assigned to the generated Mapsui layer.

public string LayerName { get; set; }

Property Value

string

LineStyleProvider

Optional function that returns a LineStyle definition by name. When set, line instructions that carry only a lineStyleReference (e.g. S-421 RTEACTLEGLINE) will render using the referenced colour, width, and dash pattern from the portrayal catalogue.

public Func<string, LineStyle?>? LineStyleProvider { get; set; }

Property Value

Func<string, LineStyle>

Options

Optional captured Mapsui rendering configuration. When null, settings that have not been overridden directly are read from the legacy process-global RenderingOptimizations store.

public S100MapsuiOptions? Options { get; init; }

Property Value

S100MapsuiOptions

OutOfBandMinDisplayScale

Optional dataset-wide out-of-scale-band cap, as an S-100 Part 9 §11.1 scale denominator (the cell's most-permissive DataCoverage.minimumDisplayScale; S-101 FC §3.1.1). Applies only to the TiledScene ("B") render subsystem: it is propagated onto the VectorScene ops so that, like the Mapsui ("A") feature path (MapsuiDatasetRenderer.ApplyOutOfScaleBandCap), features lacking their own SCAMIN are hidden once the display is zoomed out past the cell's compilation scale. null (the default) applies no cap.

public int? OutOfBandMinDisplayScale { get; set; }

Property Value

int?

Palette

The color palette to use for resolving S-100 color tokens. When set, overrides the built-in fallback colors.

public ColorPalette? Palette { get; set; }

Property Value

ColorPalette

PatternClipCache

Optional cache for the pattern-fill priority clip result. When set together with PatternClipCacheKey, the renderer obtains the clipped pattern geometry via GetOrCompute(string, Func<IReadOnlyList<(string PatternRef, int Priority, Geometry Geometry)>>) so re-renders that do not change the clip inputs (most importantly Day/Dusk/Night palette switches) skip the expensive NetTopologySuite overlay. When unset, the clip is computed inline on every render, preserving legacy behaviour for products without pattern fills and for ad-hoc / one-shot callers.

public IPatternClipCache? PatternClipCache { get; init; }

Property Value

IPatternClipCache

PatternClipCacheKey

Key that fully identifies this render's pattern-clip inputs (for S-101, the mariner + ECDIS display-state portrayal cache key). Used with PatternClipCache; ignored when either is null.

public string? PatternClipCacheKey { get; init; }

Property Value

string

PreferLiveDrawing

The product's PreferLiveDrawing hint, stamped on the scene so the tiled renderer may draw it directly.

public bool PreferLiveDrawing { get; set; }

Property Value

bool

Product

Optional S-100 product identifier (e.g. "S-101", "S-131") used as the s100.product dimension on cache and render-frame metrics. Set by dataset processors so cache hit/miss counts can be attributed by product. When null, the counter is emitted without a product tag (preserving legacy behaviour for direct callers).

public string? Product { get; set; }

Property Value

string

SymbolProvider

Optional function that returns raw SVG content for a symbol name (e.g. "POSGEN03" → the contents of POSGEN03.svg). When set, point features will render using actual SVG symbols.

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

Property Value

Func<string, string>

SymbolScale

Global scale factor applied to all point symbols (default 1.0).

public double SymbolScale { get; set; }

Property Value

double

TextScale

Global scale factor applied to all text labels (default 1.0).

public double TextScale { get; set; }

Property Value

double

Methods

Render(IReadOnlyList<DrawingInstruction>, IFeatureGeometryProvider)

Renders the supplied display list against the geometry provided by geometryProvider, returning a Mapsui memory layer.

public ILayer Render(IReadOnlyList<DrawingInstruction> instructions, IFeatureGeometryProvider geometryProvider)

Parameters

instructions IReadOnlyList<DrawingInstruction>
geometryProvider IFeatureGeometryProvider

Returns

ILayer

Remarks

Drawing instructions whose feature reference cannot be resolved by the provider are silently skipped; this lets callers pre-process the list (e.g. merging S-101 SAFCON labels) without worrying about synthesised feature references.

RenderFeatures(IReadOnlyList<DrawingInstruction>, IFeatureGeometryProvider)

Lowers the display list into self-styled Mapsui features (symbol images, labels, lines and areas, in Part 9 draw order) without binding a tiled scene renderer. Each feature carries its FeatureRefKey and scale limits.

public IReadOnlyList<IFeature> RenderFeatures(IReadOnlyList<DrawingInstruction> instructions, IFeatureGeometryProvider geometryProvider)

Parameters

instructions IReadOnlyList<DrawingInstruction>

The display list.

geometryProvider IFeatureGeometryProvider

Resolves the instructions' feature references.

Returns

IReadOnlyList<IFeature>

The styled features; instructions whose feature can't be resolved are skipped.

Remarks

Render(IReadOnlyList<DrawingInstruction>, IFeatureGeometryProvider) paints its layer with the tiled scene renderer and keeps the features only for picking. These features draw on their own, so they can go into any plain Mapsui.Layers.MemoryLayer, such as a dynamic source's overlay layer (see PortrayedDynamicFeatureRenderer). Use it for a handful of features, not a chart.