Table of Contents

Class SampleCoverageService

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

Samples a coverage product at a single lat/lon, returning the nearest grid cell's (or station's) value. Any product whose catalog payload is an ICoverageSampler is supported: S-102 (depth + uncertainty), S-104 (water level height + trend, nearest time step) and S-111 (surface current speed + direction, nearest time step) today.

public sealed class SampleCoverageService
Inheritance
SampleCoverageService
Inherited Members

Remarks

The service picks the catalog's datasets of the requested spec that carry a sampler and hands them to CoverageSampling, which chooses the dataset and site and applies the time handling; it then maps the outcome onto SampleCoverageResult and the tool errors. It knows no product: a new one is sampled as soon as its datasets reach the catalog with a sampler (a ProductDatasetData that implements ICoverageSampler, for example).

"Nearest cell" semantics: the cell whose centre is closest to the requested point. No interpolation is performed. For time-varying products the nearest time step is selected; ties round to the earlier step.

Dataset selection is time-aware: of the datasets covering the point, those whose time range contains the requested time are preferred, and the finest grid (or nearest station) among them wins; equally fine candidates prefer the newest run. A request within one time-step interval of either end of a dataset's range counts as in range.

A single instant outside every candidate's range returns TimeOutOfRange unless the request opts into Nearest, in which case the nearest step is returned and TimeStatus says which end was used. Windowed queries return the covered part of the window, flagged Truncated when the data does not reach across the whole window, and error only when there is no overlap at all (issue #789).

A spec is reported as SpecNotSupportedForTool when no loaded dataset of it has a sampler and it is not one of the products this assembly samples (so a request for S-102 with nothing loaded is still NoDatasetCoversPoint).

Constructors

SampleCoverageService(IDatasetCatalog, ICrsTransformFactory)

Creates a new SampleCoverageService.

public SampleCoverageService(IDatasetCatalog catalog, ICrsTransformFactory transforms)

Parameters

catalog IDatasetCatalog

The catalog of loaded datasets to sample from.

transforms ICrsTransformFactory

Factory used to reproject the WGS-84 request point into a coverage's native CRS before grid indexing — required for correct sampling of projected S-102 tiles (e.g. UTM zone 31N), whose grid georeferencing is native metres rather than degrees.

Fields

Name

Tool name used in SpecNotSupportedForTool errors.

public const string Name = "sample_coverage"

Field Value

string

Methods

InvokeAsync(SampleCoverageRequest, CancellationToken)

Executes the tool.

public Task<ToolResult<SampleCoverageResult>> InvokeAsync(SampleCoverageRequest request, CancellationToken cancellationToken = default)

Parameters

request SampleCoverageRequest
cancellationToken CancellationToken

Returns

Task<ToolResult<SampleCoverageResult>>