Table of Contents

Class LayerStackProjector

Namespace
EncDotNet.S100.Datasets.Pipelines.Interoperability
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

Maps the renderer-neutral, S-98-ordered / suppressed SubLayerStackItem list produced by the engine (Build(IInteroperabilityAuthority, IReadOnlyList<IReadOnlyList<SubLayerStackItem>>) + ApplyRules(IReadOnlyList<SubLayerStackItem>, IReadOnlyList<LoadedDatasetInfo>, MarinerSettings?, IReadOnlyCollection<S98InteroperabilityRule>?)) back onto the Mapsui Mapsui.Layers.ILayer objects the viewer paints, without re-running the expensive display-list rasterisation for suppressed layers.

public static class LayerStackProjector
Inheritance
LayerStackProjector
Inherited Members

Remarks

Issue #398: the S-98 engine now lives in the Mapsui-free Datasets.Pipelines assembly and operates on SubLayerStackItem. The viewer builds its Mapsui.Layers.ILayers once at load time (pattern-fill clipping is multi-second), so re-rasterising a suppression-filtered sub-layer would be both slow and a regression risk.

Instead, this projector reuses each item's prebuilt Mapsui.Layers.ILayer and, when the engine replaced a vector payload's VectorSubLayer (R-101-102-B depth suppression), drops exactly the same features from the already-built Mapsui Mapsui.Layers.MemoryLayer by comparing the original and surviving instruction FeatureReference sets. The removed set is byte-identical to the legacy in-place Mapsui feature filter, so the viewer's golden-image output does not change (S-98 Annex A §8.4.1; MSC.232(82) §5.8).

Methods

KeyOf(SubLayerStackItem)

Returns the stable (dataset id, sub-layer key) join key used to match a neutral SubLayerStackItem back to its prebuilt Mapsui layer.

public static (string DatasetId, string LayerKey) KeyOf(SubLayerStackItem item)

Parameters

item SubLayerStackItem

The stack item to key.

Returns

(string DatasetId, string LayerKey)

The composite lookup key.

Project(IReadOnlyList<SubLayerStackItem>, IReadOnlyDictionary<(string DatasetId, string LayerKey), LayerStackEntry>, Func<CoverageSubLayerBase, ILayer?>?)

Projects the S-98-ruled item list onto prebuilt Mapsui layers.

public static IReadOnlyList<LayerStackEntry> Project(IReadOnlyList<SubLayerStackItem> ruledItems, IReadOnlyDictionary<(string DatasetId, string LayerKey), LayerStackEntry> prebuilt, Func<CoverageSubLayerBase, ILayer?>? rebuildCoverage = null)

Parameters

ruledItems IReadOnlyList<SubLayerStackItem>

The ordered, suppression-applied items from the engine.

prebuilt IReadOnlyDictionary<(string DatasetId, string LayerKey), LayerStackEntry>

Lookup from KeyOf(SubLayerStackItem) to the prebuilt LayerStackEntry (its Layer is the rasterised layer and its Item carries the original, un-suppressed payload).

rebuildCoverage Func<CoverageSubLayerBase, ILayer>

Optional callback that rebuilds a coverage sub-layer the engine replaced (e.g. an S-104 surface with a land-area mask attached). When omitted, or when it returns null, the prebuilt layer is reused.

Returns

IReadOnlyList<LayerStackEntry>

One LayerStackEntry per input item, wrapping the reused (or suppression-filtered) Mapsui.Layers.ILayer and the ruled item. Items with no prebuilt layer are skipped.

ToLayerList(IEnumerable<LayerStackEntry>)

Flattens an ordered LayerStackEntry list into the bare Mapsui.Layers.ILayer list the map host consumes, preserving order.

public static List<ILayer> ToLayerList(IEnumerable<LayerStackEntry> entries)

Parameters

entries IEnumerable<LayerStackEntry>

The ordered stack entries.

Returns

List<ILayer>

The layers in the same order.