Table of Contents

Class S111CoverageSource

Namespace
EncDotNet.S100.Datasets.S111
Assembly
EncDotNet.S100.Datasets.S111.dll

Adapts an S-111 S111Dataset to the pipeline-facing ICoverageSource. Each time step in the dataset is one coverage; SelectTime(DateTime) chooses which one is sampled.

public class S111CoverageSource : ICoverageSource
Inheritance
S111CoverageSource
Implements
Inherited Members

Constructors

S111CoverageSource(S111Dataset)

Creates a coverage source over the given S-111 dataset, initially positioned at the first time step.

public S111CoverageSource(S111Dataset dataset)

Parameters

dataset S111Dataset

The parsed S-111 dataset.

Fields

FillValue

S-111 standard fill value for no-data cells.

public const float FillValue = -9999

Field Value

float

Properties

AvailableTimes

The time steps this coverage can be sampled at, in the order the dataset stores them. Empty for static products (S-102); populated for time-varying products (S-104, S-111).

public IReadOnlyList<DateTime> AvailableTimes { get; }

Property Value

IReadOnlyList<DateTime>

Remarks

One entry per time step, in dataset order.

Dataset

The underlying parsed S-111 dataset.

public S111Dataset Dataset { get; }

Property Value

S111Dataset

Metadata

File-level metadata: extent, grid geometry, CRS, no-data sentinel and the value fields the source carries. Available immediately after the source is constructed.

public CoverageMetadata Metadata { get; }

Property Value

CoverageMetadata

Remarks

Implementations may build a new instance on every read. The GridMetadata reflects the currently selected overview level (see SelectOverviewLevel(int)).

Spec

The dataset's declared product specification, resolved from DeclaredProductSpecification; the edition is default (unknown) when the file declares none.

public SpecRef Spec { get; }

Property Value

SpecRef

Methods

Sample(GridRegion, CancellationToken)

Copies the requested grid region into a SampledCoverage. The underlying grid is already resident in memory (the HDF5 read happens at construction time), so this is a CPU-bound copy rather than an I/O operation; cancellationToken lets a large copy be abandoned cooperatively. The method remains synchronous.

public SampledCoverage Sample(GridRegion region, CancellationToken cancellationToken = default)

Parameters

region GridRegion

The grid subset and stride to sample.

cancellationToken CancellationToken

Signals that the render has been cancelled.

Returns

SampledCoverage

The sampled values for every field in ValueFields, at the currently selected time step and overview level. The result's Metadata describes the geometry of the sampled sub-grid itself (output row/column count, origin and spacing in the native CRS), so GetPosition(int, int) locates each output cell. How cells skipped by a stride greater than one are combined (plain decimation or a reduction such as S-102's shoalest-depth minimum) is source-specific. An empty region yields a zero-cell sample.

Remarks

Samples the time step chosen by SelectTime(DateTime).

Exceptions

OperationCanceledException

cancellationToken was cancelled during the copy.

SelectTime(DateTime)

Selects the time step served by subsequent Sample(GridRegion, CancellationToken) calls.

public void SelectTime(DateTime time)

Parameters

time DateTime

The requested time. Time-varying sources select the exact match in AvailableTimes when present, otherwise the nearest available time step. Static sources treat the call as a no-op.

Remarks

Selects the time step that matches time exactly, or otherwise the nearest one.