Class S104TimeSeriesSampler
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
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
coverageWaterLevelCoverageThe coverage grid.
rowintRow (latitudinal index) of the cell.
colintColumn (longitudinal index) of the cell.
Returns
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
coverageWaterLevelCoverageThe coverage grid.
latitudedoubleLatitude of the query point in decimal degrees.
longitudedoubleLongitude of the query point in decimal degrees.
Returns
- bool
truewhen 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
coverageWaterLevelCoverageThe coverage grid.
latitudedoubleLatitude of the query point in decimal degrees.
longitudedoubleLongitude of the query point in decimal degrees.
Returns
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
datasetS104DatasetThe S-104 dataset to sample.
latitudedoubleLatitude of the query point in decimal degrees.
longitudedoubleLongitude of the query point in decimal degrees.
fromDateTime?Optional inclusive lower time bound; time steps earlier than this are skipped. When
nullthe series is unbounded below.toDateTime?Optional inclusive upper time bound; time steps later than this are skipped. When
nullthe series is unbounded above.
Returns
- S104TimeSeries
A S104TimeSeries for the nearest cell, or
nullwhen 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
datasetisnull.
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
coverageWaterLevelCoverageThe coverage grid.
rowintRow (latitudinal index) of the cell.
colintColumn (longitudinal index) of the cell.
Returns
- double?
The height in metres, or
nullfor 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
coverageWaterLevelCoverageThe coverage grid.
rowintRow (latitudinal index) of the cell.
colintColumn (longitudinal index) of the cell.
Returns
- byte
The raw S-104
waterLevelTrendcode.