Table of Contents

Class S104TimeSeriesSampler

Namespace
EncDotNet.S100.Datasets.S104
Assembly
EncDotNet.S100.Datasets.S104.dll

Samples an S-104 regular-grid (dcf=2) water-level dataset at an arbitrary geographic point across its time steps, producing a per-step height series suitable for depth-over-time visualisations and tide reconciliation.

public static class S104TimeSeriesSampler
Inheritance
S104TimeSeriesSampler
Inherited Members

Remarks

The sampler operates in the coverage's geographic coordinate space (EPSG:4326 for S-104 regular grids per S-104 Ed 2.0.0) using nearest-cell selection; it does not reproject. Only the gridded coding format (dataCodingFormat = 2) is supported — other formats return null.

Fields

FillValue

The NoData sentinel used for absent water-level heights, matching FillValue.

public const float FillValue = -9999

Field Value

float

Methods

CellPosition(WaterLevelCoverage, int, int)

Computes the geographic centre of the given grid cell.

public static (double CellLatitude, double CellLongitude) CellPosition(WaterLevelCoverage coverage, int row, int col)

Parameters

coverage WaterLevelCoverage

The coverage grid.

row int

Row (latitudinal index) of the cell.

col int

Column (longitudinal index) of the cell.

Returns

(double X, double Y)

The (latitude, longitude) of the cell centre in decimal degrees.

Contains(WaterLevelCoverage, double, double)

Tests whether the point falls within the node extent of coverage. Handles negative spacing (origin at the north/east edge).

public static bool Contains(WaterLevelCoverage coverage, double latitude, double longitude)

Parameters

coverage WaterLevelCoverage

The coverage grid.

latitude double

Latitude of the query point in decimal degrees.

longitude double

Longitude of the query point in decimal degrees.

Returns

bool

true when the point lies within the grid extent.

NearestCell(WaterLevelCoverage, double, double)

Finds the nearest grid cell to the given point, clamped to the grid bounds.

public static (int Row, int Col) NearestCell(WaterLevelCoverage coverage, double latitude, double longitude)

Parameters

coverage WaterLevelCoverage

The coverage grid.

latitude double

Latitude of the query point in decimal degrees.

longitude double

Longitude of the query point in decimal degrees.

Returns

(int Row, int Col)

The (row, column) index of the nearest cell.

Sample(S104Dataset, double, double, DateTime?, DateTime?)

Samples dataset at the given point across every time step falling within the optional from/to window (inclusive).

public static S104TimeSeries? Sample(S104Dataset dataset, double latitude, double longitude, DateTime? from = null, DateTime? to = null)

Parameters

dataset S104Dataset

The S-104 dataset to sample.

latitude double

Latitude of the query point in decimal degrees.

longitude double

Longitude of the query point in decimal degrees.

from DateTime?

Optional inclusive lower time bound; time steps earlier than this are skipped. When null the series is unbounded below.

to DateTime?

Optional inclusive upper time bound; time steps later than this are skipped. When null the series is unbounded above.

Returns

S104TimeSeries

A S104TimeSeries for the nearest cell, or null when the dataset is not a supported gridded dataset, has no coverages, has a degenerate grid geometry, or the point falls outside the grid extent.

Exceptions

ArgumentNullException

dataset is null.

SampleHeight(WaterLevelCoverage, int, int)

Reads the water-level height at the given cell, returning null when the cell holds the NoData fill value.

public static double? SampleHeight(WaterLevelCoverage coverage, int row, int col)

Parameters

coverage WaterLevelCoverage

The coverage grid.

row int

Row (latitudinal index) of the cell.

col int

Column (longitudinal index) of the cell.

Returns

double?

The height in metres, or null for NoData.

SampleTrend(WaterLevelCoverage, int, int)

Reads the raw water-level trend code at the given cell.

public static byte SampleTrend(WaterLevelCoverage coverage, int row, int col)

Parameters

coverage WaterLevelCoverage

The coverage grid.

row int

Row (latitudinal index) of the cell.

col int

Column (longitudinal index) of the cell.

Returns

byte

The raw S-104 waterLevelTrend code.