Table of Contents

Class FileDatasetCatalog

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

A read-only, file-backed IDatasetCatalog built once from a fixed set of dataset files — the headless counterpart to the viewer's live catalog, used by the CLI identify command to run the same pick services (IdentifyFeaturesService / SampleCoverageService) the MCP surface exposes, without an open viewer or MCP server.

public sealed class FileDatasetCatalog : IDatasetCatalog
Inheritance
FileDatasetCatalog
Implements
Inherited Members

Remarks

Each input is opened, sniffed to its product specification by the caller, and projected via LoadedDatasetProjector so the catalog entries are byte-identical to those a viewer would produce. Vector products (S-101 and the GML specs) are fully materialised into managed model objects; coverage products (S-102 / S-104 / S-111) are read eagerly into managed value arrays, so the snapshot is self-contained and no file handle is held open past Build(IEnumerable<FileDatasetInput>, ICrsTransformFactory?, ILuaEngine?).

The catalog is immutable: Changed is declared to satisfy IDatasetCatalog but never raised. A file that cannot be opened, parsed, or whose spec is unsupported is skipped and reported via Warnings rather than failing the whole build.

Properties

Datasets

Atomic, immutable snapshot of all datasets currently loaded. Implementations publish a fresh array on every change; consumers may capture the reference for the duration of an operation without locking.

public IReadOnlyList<LoadedDataset> Datasets { get; }

Property Value

IReadOnlyList<LoadedDataset>

Warnings

Human-readable warnings for inputs that were skipped (unsupported spec, missing file, or a parse failure), in input order.

public IReadOnlyList<string> Warnings { get; }

Property Value

IReadOnlyList<string>

Methods

Build(IEnumerable<FileDatasetInput>, ICrsTransformFactory?, ILuaEngine?)

Builds a catalog by projecting each input file into a LoadedDataset.

public static FileDatasetCatalog Build(IEnumerable<FileDatasetInput> inputs, ICrsTransformFactory? transforms = null, ILuaEngine? luaEngine = null)

Parameters

inputs IEnumerable<FileDatasetInput>

The dataset files to load, in the desired order.

transforms ICrsTransformFactory

Optional CRS transform factory used when projecting coverage bounds. For projected S-102 tiles (e.g. UTM) this reprojects the native grid extent into WGS-84 so Bounds matches the WGS-84 point-in-bounds test used when sampling; when null a naive fallback is used, which leaves projected-tile bounds in native metres.

luaEngine ILuaEngine

A Lua engine, so route checks over the catalog can portray S-101 cells for their alerts (#1127); see Project(DatasetId, string, Stream, Func<string, string?>?, ICrsTransformFactory?, ProductRegistry?, ILuaEngine?).

Returns

FileDatasetCatalog

An immutable catalog whose Datasets holds every successfully projected input and whose Warnings reports the rest.

Events

Changed

Raised after Datasets has been updated. The event reports what changed; consumers needing the new state read Datasets directly.

public event EventHandler<DatasetCatalogChangedEventArgs>? Changed

Event Type

EventHandler<DatasetCatalogChangedEventArgs>

Remarks

Never raised — the catalog is a fixed, one-shot snapshot.