Table of Contents

Class S131DatasetProcessor

Namespace
EncDotNet.S100.Datasets.Pipelines
Assembly
EncDotNet.S100.Datasets.Pipelines.dll

IDatasetProcessor for IHO S-131 Marine Harbour Infrastructure GML datasets. Drives the S-100 Part 9A Lua portrayal pipeline (the same engine used by S-101), combining GML data reading with Lua-based portrayal — a first in this codebase.

public sealed class S131DatasetProcessor : IDatasetProcessor, IVectorPortrayalSource, ILoadedDatasetProjection
Inheritance
S131DatasetProcessor
Implements
Inherited Members

Remarks

S-131 Edition 2.0.0 (feature and portrayal catalogues). Application namespace http://www.iho.int/S131/2.0 (http://www.iho.int/S131/1.0 in Edition 1.0.0) over the S-100 GML 5.0 profile.

Unlike the other GML-encoded products (S-122, S-124, S-125, S-127, S-128, S-411, S-421) which extend GmlDatasetProcessorBase<TFeature> for XSLT portrayal, S-131 uses a custom processor because its portrayal catalogue is Lua-based (Part 9A), requiring the same pipeline shape as S101DatasetProcessor.

Constructors

S131DatasetProcessor(IAssetSource, string, PortrayalCatalogueManager, ILuaEngine, FeatureCatalogueManager)

Initializes a new S131DatasetProcessor by reading the dataset file relativePath from source. Used by exchange-set bulk loading.

public S131DatasetProcessor(IAssetSource source, string relativePath, PortrayalCatalogueManager catalogueManager, ILuaEngine luaEngine, FeatureCatalogueManager featureCatalogueManager)

Parameters

source IAssetSource
relativePath string
catalogueManager PortrayalCatalogueManager
luaEngine ILuaEngine
featureCatalogueManager FeatureCatalogueManager

S131DatasetProcessor(string, PortrayalCatalogueManager, ILuaEngine, FeatureCatalogueManager)

Initializes a new S131DatasetProcessor from a file path.

public S131DatasetProcessor(string path, PortrayalCatalogueManager catalogueManager, ILuaEngine luaEngine, FeatureCatalogueManager featureCatalogueManager)

Parameters

path string
catalogueManager PortrayalCatalogueManager
luaEngine ILuaEngine
featureCatalogueManager FeatureCatalogueManager

Properties

AxisOrder

The outcome of the dataset-level axis-order check the reader ran on the dataset's positions (issue #650), or null when the product has no positions to check or the reader does not run it. A Swapped outcome means the reader swapped latitude and longitude for the whole dataset (when Normalized is set). Surfaced by hosts (CLI info, the viewer's dataset list) and, when swapped or inconsistent, as a {product}-PROJ-AXIS warning in Validate().

public AxisOrderAssessment? AxisOrder { get; }

Property Value

AxisOrderAssessment

Spec

The product specification (name + edition) this dataset declares conformance to. Each per-spec processor returns a fixed name (e.g. "S-101"); the edition portion is populated from the dataset itself (HDF5 productSpecification attribute, GML application namespace, S-101 ProductSpecificationEdition, etc.) when known, otherwise defaults to SpecVersion default.

public SpecRef Spec { get; }

Property Value

SpecRef

VersionAssessment

How the dataset's declared product specification edition (Spec) relates to the version of the catalogue used to process it, or null when no catalogue self-describes its version (so no assessment can be made). Computed once at construction — catalogue resolution is a one-shot per processor — and surfaced by hosts (CLI info/render, viewer layer list) to warn on a version mismatch per S-100 Edition 5.2.1 Part 2 §6.

public SpecVersionAssessment? VersionAssessment { get; }

Property Value

SpecVersionAssessment

Methods

BuildVectorPortrayalAsync(RenderContext?, CancellationToken)

Builds an immutable, Mapsui-free snapshot of this dataset's vector portrayal for the supplied render context. Implementations run under the processor's render gate and snapshot all mutable portrayal state (palette, ECDIS display, asset pre-warm) so the result is safe to convert to Mapsui layers off the gate.

public Task<VectorPortrayalResult> BuildVectorPortrayalAsync(RenderContext? context = null, CancellationToken cancellationToken = default)

Parameters

context RenderContext

Optional render context (palette, scales, ECDIS, mariner).

cancellationToken CancellationToken

Cancellation token.

Returns

Task<VectorPortrayalResult>

The Mapsui-free vector portrayal result.

CreateLoadedData()

Allocates the LoadedDatasetData variant wrapping this processor's already-parsed model. Never re-reads the source bytes.

public LoadedDatasetData CreateLoadedData()

Returns

LoadedDatasetData

The catalog payload wrapping the resident model (e.g. an S125DatasetData or S102CoverageData).

EnumerateFeatures()

Enumerates a lightweight summary of every feature exposed by this processor — used to seed the viewer's feature-search index without forcing a full GetFeatureInfo(string) call per feature.

public IEnumerable<FeatureSummary> EnumerateFeatures()

Returns

IEnumerable<FeatureSummary>

Remarks

Coverage products (S-102, S-104, S-111) and any processor that does not expose discrete features should leave this returning the default empty enumeration.

GetFeatureInfo(string)

Returns information about a feature identified by its reference string (as stored in the rendered feature via the renderer's feature-ref key), or null if the feature cannot be found.

public FeatureInfo? GetFeatureInfo(string featureRef)

Parameters

featureRef string

Returns

FeatureInfo

Remarks

Real-world datasets occasionally contain features that share a gml:id (a producer bug), so callers that already know the feature's position within the dataset should prefer GetFeatureInfoAt(int) for a collision-free lookup.

GetFeatureInfoAt(int)

Returns information about the feature at the given enumeration ordinal — the same index reported via Ordinal from EnumerateFeatures(). Used by the search index so duplicate gml:ids (a real producer bug) still route to the correct feature.

public FeatureInfo? GetFeatureInfoAt(int ordinal)

Parameters

ordinal int

Returns

FeatureInfo

Feature info, or null when the ordinal is out of range or this processor does not expose discrete features.

Validate()

Runs the spec's normative validation rule pack against this processor's parsed dataset and returns the aggregated report, or null when no rule pack is available for the spec (e.g. coverage products and S-101 / S-201 / S-57 today).

public ValidationReport? Validate()

Returns

ValidationReport

Remarks

Validation is a pure function of the parsed dataset and does not depend on the current palette, opacity, or selected time step; callers cache the report rather than re-running it on every render. Implementations should run the projection (S125AtonDataset.From(...), etc.) lazily and cache the resulting ValidationReport on a private field so repeated calls are cheap.

A return value of null means "no rule pack is yet defined for this spec" — distinct from Empty, which means "rules were evaluated and found nothing".