Class S111CoverageSource
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
datasetS111DatasetThe parsed S-111 dataset.
Fields
FillValue
S-111 standard fill value for no-data cells.
public const float FillValue = -9999
Field Value
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
Remarks
One entry per time step, in dataset order.
Dataset
The underlying parsed S-111 dataset.
public S111Dataset Dataset { get; }
Property Value
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
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
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
regionGridRegionThe grid subset and stride to sample.
cancellationTokenCancellationTokenSignals 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
cancellationTokenwas cancelled during the copy.
SelectTime(DateTime)
Selects the time step served by subsequent Sample(GridRegion, CancellationToken) calls.
public void SelectTime(DateTime time)
Parameters
timeDateTimeThe 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.