Table of Contents

Class S104DatasetRules

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

The default ValidationRuleSet<TModel> of normative rules for an S-104 S104Dataset. Rule identifiers follow the convention S104-R-{clause} for normative rules and S104-PROJ-{kind} for projection-diagnostic surrogates, traceable back to S-104 (Edition 2.0.0) and S-100 Part 10c.

public static class S104DatasetRules
Inheritance
S104DatasetRules
Inherited Members

Remarks

This is the V-2 rule pack as defined in docs/design/non-gml-validation.md §6.2. Rules read off the strongly-typed S104Dataset produced by S104DatasetReader; structural-schema failures the reader cannot tolerate are thrown as S100DatasetSchemaException at read time (and unsupported data-coding-format selections as S100DatasetNotSupportedException) and (per design §5.1 and §5.3) surfaced as S104-PROJ-SCHEMA / S104-PROJ-UNSUPPORTED findings by the dataset processor's Validate() wrapper.

V-2 introduces the time-axis rule pattern (R-2.1 monotonicity, R-2.2 cadence). V-3 (S-111) reuses these patterns against SurfaceCurrentCoverage.

Tier-3 cross-dataset rules are out of scope; per-finding payload conventions follow design §4.3:

  • per-coverage finding — RelatedFeatureId = "{groupPath}"
  • per-time-step finding — RelatedFeatureId = "{groupPath}#timePoint"

Properties

CoverageGeoreferencingInRange

S104-R-4.2 — Each coverage's grid origin and far corner (origin + (numPoints - 1) × spacing) are plausible positions in the dataset's HorizontalCRS: within [-90, 90] / [-180, 180] degrees for a geographic CRS (so the extent does not wrap the antimeridian or cross the pole), or within the projected bounds (and reprojecting to a valid WGS 84 position) for a projected one.

public static IValidationRule<S104Dataset> CoverageGeoreferencingInRange { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Folds the V-1 S102-R-4.1 (origin range) and S102-R-4.2 (extent range) into a single rule because the S-104 time-series shape already inflates the per-coverage rule count. Per-coverage finding; populates BoundingBox with the offending tile extent in WGS 84 (edges ordered; values may themselves be out of range) — for a projected grid only when it can be reprojected. S-100 names the grid attributes gridOriginLatitude / gridOriginLongitude whatever the CRS, so for a projected grid they are metres; see GridGeoreferencing for the CRS-specific checks (a CRS it cannot classify is not checked). Spec reference: S-100 Part 10c §10.2.1.2 (grid georeferencing). Implements the s104-water-level skill review-checklist items "georeferencing attributes within range" and "tile extent stays within range".

CoverageValuesLengthMatchesShape

S104-R-1.1 — Every WaterLevelCoverage's Values array length equals NumPointsLatitudinal × NumPointsLongitudinal.

public static IValidationRule<S104Dataset> CoverageValuesLengthMatchesShape { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Spec reference: S-100 Part 10c §10.2.1.2 (gridded coverage shape contract) and S-104 Edition 2.0.0 §10.2 / §12 (WaterLevel feature). Implements the s104-water-level skill review-checklist item "values array shape matches numPointsLat × numPointsLon".

DataCodingFormatIsSupported

S104-R-1.2 — DataCodingFormat is in the supported set {2, 3} (regular grid / ungeorectified grid). The reader currently rejects other formats at parse time (raising S100DatasetNotSupportedException); this rule documents intent so future reader changes do not silently widen the supported set.

public static IValidationRule<S104Dataset> DataCodingFormatIsSupported { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Spec reference: S-100 Part 10c §10.2.1 (data coding format enumeration); S-104 Edition 2.0.0 §10.2 (dataCodingFormat root attribute on the WaterLevel group). Implements the s104-water-level skill review-checklist item "data coding format is the supported gridded set".

Default

The canonical default rule set for S-104 water-level datasets.

public static ValidationRuleSet<S104Dataset> Default { get; }

Property Value

ValidationRuleSet<S104Dataset>

MethodSetForTimeSeries

S104-R-3.1 — MethodWaterLevelProduct is set (non-null, non-empty) when the dataset contains more than one coverage (i.e. is itself a time series, where the method provenance is operationally important).

public static IValidationRule<S104Dataset> MethodSetForTimeSeries { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Spec reference: S-104 Edition 2.0.0 §12 / §10.2.3 (methodWaterLevelProduct attribute on the WaterLevel container; recommended for forecast and hindcast products). Implements the s104-water-level skill review-checklist item "provenance attributes populated on multi-step datasets".

ProjectionSchemaSurrogate

S104-PROJ-SCHEMA — defensive projection-diagnostic surrogate (design §5.1, §5.3).

public static IValidationRule<S104Dataset> ProjectionSchemaSurrogate { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

The rule body is intentionally a no-op: by the time the rule pack runs the dataset is already constructed, so any S100DatasetSchemaException has already thrown out of the reader. The rule id is reserved in this rule set so that S104DatasetProcessor.Validate() can emit a single-finding report carrying the exception's GroupPath, AttributeOrDataset, and SpecReference under this same rule id when the defensive try/catch around the rule-pack call fires.

ProjectionUnsupportedSurrogate

S104-PROJ-UNSUPPORTED — projection-diagnostic surrogate for an S100DatasetNotSupportedException (design §5.3). In practice this fires when the underlying HDF5 dataset uses a data coding format the reader has not implemented (e.g. dcf 8 station-series, which lacks an S104Dataset view), or when a future reader change widens the rejected set.

public static IValidationRule<S104Dataset> ProjectionUnsupportedSurrogate { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

The rule body is a no-op (analogous to ProjectionSchemaSurrogate); S104DatasetProcessor.Validate() emits findings under this rule id directly when it detects the dcf8 variant or when its defensive try/catch traps the exception.

TimePointsStrictlyIncreasing

S104-R-2.1 — Coverages ordered by TimePoint are strictly increasing. Emits a single finding at the first violation; later violations are usually cascade noise and are suppressed per docs/design/non-gml-validation.md §7.2.

public static IValidationRule<S104Dataset> TimePointsStrictlyIncreasing { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Spec reference: S-104 Edition 2.0.0 §10.2.5 (timePoint attribute on each Group_NNN); S-100 Part 10c §10.2.6 (time-series group sequence). Implements the s104-water-level skill review-checklist item "time-step groups are monotonic in time".

TimeStepCadenceWithinTolerance

S104-R-2.2 — Successive TimePoint deltas vary by no more than ±10% of the median delta. Skipped when Coverages.Count < 3 (a single delta has no comparison). One finding per offending gap.

public static IValidationRule<S104Dataset> TimeStepCadenceWithinTolerance { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Spec reference: S-104 Edition 2.0.0 §10.2.5 / §12.3 (timeRecordInterval) — operational consumers assume near-uniform cadence. Implements the s104-water-level skill review-checklist item "time-step cadence is uniform within tolerance". The rule deliberately uses the median (not the mean) delta as the reference so a single missing step does not skew the tolerance for the rest of the series.

WaterLevelValuesInPlausibleRange

S104-R-4.1 — Non-NODATA water-level Height values across each coverage lie within the plausible range [-15, 15] metres. NODATA cells (finite values equal to EncDotNet.S100.Datasets.S104.Validation.S104DatasetRules.NoDataValue, plus NaN and ±PositiveInfinity) are excluded from the range check.

public static IValidationRule<S104Dataset> WaterLevelValuesInPlausibleRange { get; }

Property Value

IValidationRule<S104Dataset>

Remarks

Plausibility heuristic: tides, surges, and routine meteorological forcing rarely exceed ±15 m even in extreme estuaries; catches common producer mistakes such as a centimetre scaling factor left applied or a missing datum subtraction. One finding per offending coverage with the count of out-of-range cells in the message; emitting one finding per cell on a broken tile would drown the report in cascade noise (design §6.2). Spec reference: S-104 Edition 2.0.0 §12 (waterLevelHeight units). Implements the s104-water-level skill review-checklist item "water-level values within physically plausible range".

Methods

Validate(S104Dataset, ValidationContext?)

Convenience wrapper around Run(TModel, ValidationContext?) using the Default rule set.

public static ValidationReport Validate(S104Dataset dataset, ValidationContext? context = null)

Parameters

dataset S104Dataset
context ValidationContext

Returns

ValidationReport