Table of Contents

Class LoadedDatasetProjector

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

Projects a single S-100 dataset into the typed LoadedDataset carried by an IDatasetCatalog.

public static class LoadedDatasetProjector
Inheritance
LoadedDatasetProjector
Inherited Members

Remarks

There are two ways in: from the raw Stream of a dataset already detected as a known product specification (Project(DatasetId, string, Stream, Func<string, string?>?, ICrsTransformFactory?, ProductRegistry?, ILuaEngine?)), used by the loose-file / exchange-set catalogues; and from an already-parsed IDatasetProcessor (Project(DatasetId, IDatasetProcessor, Func<string, string?>?, ICrsTransformFactory?)), used by hosts that keep a resident render processor and want to avoid parsing the dataset a second time (see issue #566). Both funnel through the single BuildFromData below, so a processor-projected LoadedDataset is byte-for-byte identical to a stream-projected one: the two entry points differ only in how they obtain the LoadedDatasetData payload — by opening a stream, or by asking the processor for the model it already holds.

The per-product Open reader is the registration's OpenData trait, looked up in a ProductRegistry (by default Default), so every host — the Avalonia viewer (ViewerDatasetCatalog) and the headless FileDatasetCatalog that backs the CLI identify command — produces byte-identical catalog entries, and a registered product needs no case here. See S-100 Edition 5.2.1 Part 1 (product specifications) and the per-spec encoding parts (10a ISO 8211 for S-101, 10b GML for the vector products, 10c HDF5 for S-102 / S-104 / S-111).

The caller owns the Stream overload's stream and must dispose it; this method reads it fully (coverage readers materialise every value into managed arrays before returning, so the backing HDF5 handle is closed eagerly here). A geometry-less container feature (e.g. an S-131 / S-127 Authority) yields no extent, so the entry falls back to world bounds.

Fields

WorldBounds

Whole-world fallback extent for datasets with no resolvable bounds.

public static readonly BoundingBox WorldBounds

Field Value

BoundingBox

Methods

Project(DatasetId, IDatasetProcessor, Func<string, string?>?, ICrsTransformFactory?)

Projects the already-parsed model held by processor into a LoadedDataset, without re-reading the dataset bytes. Lets a host that keeps a resident render processor share one parse between the query and render paths (issue #566).

public static LoadedDataset? Project(DatasetId id, IDatasetProcessor processor, Func<string, string?>? externalTextResolver = null, ICrsTransformFactory? transforms = null)

Parameters

id DatasetId

Stable identifier for the dataset within the catalog session.

processor IDatasetProcessor

The resident processor to project from.

externalTextResolver Func<string, string>

Optional S-101 external-text resolver to weave into the payload when the processor did not already carry one (e.g. an exchange-set support-file resolver the host knows but the loose-file processor does not).

transforms ICrsTransformFactory

CRS transform factory for projected coverage extents; see the stream overload.

Returns

LoadedDataset

The projected dataset, or null when the processor cannot yield a catalog payload (does not implement ILoadedDatasetProjection).

Project(DatasetId, string, Stream, Func<string, string?>?, ICrsTransformFactory?, ProductRegistry?, ILuaEngine?)

Projects stream into a LoadedDataset.

public static LoadedDataset? Project(DatasetId id, string spec, Stream stream, Func<string, string?>? externalTextResolver = null, ICrsTransformFactory? transforms = null, ProductRegistry? registry = null, ILuaEngine? luaEngine = null)

Parameters

id DatasetId

Stable identifier for the dataset within the catalog session.

spec string

The detected product specification name (e.g. "S-101", "S-102", "S-57"). The registration's OpenData reads it. A product portrayed through another specification (PortrayalSpec, e.g. a legacy "S-57" cell translated in-memory into the S-101 or S-401 model) keeps its own product identity in the entry.

stream Stream

The dataset bytes; the caller owns and disposes it.

externalTextResolver Func<string, string>

Optional file-name → text delegate for S-101 fileReference / TXTDSC / NTXTDS attributes (S-101 Feature Catalogue); null for loose cells or non-S-101 specs.

transforms ICrsTransformFactory

Optional CRS transform factory used to reproject a projected-CRS coverage extent (e.g. an S-102 tile in a UTM zone) into the WGS-84 bounds that Bounds contractually carries. When null the native grid georeferencing is treated as geographic degrees (correct only for datasets already in EPSG:4326).

registry ProductRegistry

The products to open the dataset with; null for Default.

luaEngine ILuaEngine

A Lua engine for the alert portrayal route checks use (#1127): with it, an S-101, S-401 or translated S-57 cell's payload can portray its features over the bundled catalogues (Alerts); without it, it can't.

Returns

LoadedDataset

The projected dataset, or null when spec is not a registered product with an OpenData opener.