Table of Contents

Class S421RoutePlanRules

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

The default ValidationRuleSet<TModel> of normative rules for an S-421 S421RoutePlan. Rule identifiers follow the convention S421-R-{clause}, where {clause} traces to the relevant section of the S-421 specification (IEC 63173-1).

public static class S421RoutePlanRules
Inheritance
S421RoutePlanRules
Inherited Members

Remarks

The pilot rule set focuses on Tier-1 (schema-shape) and Tier-2 (spec-semantic) rules that can be evaluated against a single S421RoutePlan in isolation. Tier-3 cross-dataset rules (e.g. comparing route waypoints to charted depths in a loaded S-102 coverage) will be added in a follow-up once the MCP validate_all surface is wired up — they need access to sibling datasets via Services.

Properties

ActionPointGeometryPopulated

S421-R-7.1 — Every RouteActionPoint must have non-empty geometry coordinates.

public static IValidationRule<S421RoutePlan> ActionPointGeometryPopulated { get; }

Property Value

IValidationRule<S421RoutePlan>

Remarks

Spec reference: S-421 Annex A "RouteActionPoint" (FC) — an action point's geometry (point / curve / surface) anchors when along the route the action applies; an action point with no coordinates has no spatial meaning.

Default

The canonical default rule set for S-421 route plans.

public static ValidationRuleSet<S421RoutePlan> Default { get; }

Property Value

ValidationRuleSet<S421RoutePlan>

LegSpeedOverGroundSane

S421-R-5.1 — When present, planned speed-over-ground values on a leg (routeWaypointLegSOGMin / routeWaypointLegSOGMax) must be non-negative and the minimum must not exceed the maximum.

public static IValidationRule<S421RoutePlan> LegSpeedOverGroundSane { get; }

Property Value

IValidationRule<S421RoutePlan>

Remarks

Spec reference: S-421 Annex A "RouteWaypointLeg" (FC) — routeWaypointLegSOGMin / routeWaypointLegSOGMax are expressed in knots and represent the planned speed envelope.

MinimumWaypointCount

S421-R-3.1 — A route must contain at least two waypoints.

public static IValidationRule<S421RoutePlan> MinimumWaypointCount { get; }

Property Value

IValidationRule<S421RoutePlan>

Remarks

A route with fewer than two waypoints cannot describe a passage: at minimum a route requires an origin and a destination. Spec reference: S-421 Annex A "Route" / "RouteWaypoint" (FC) — a Route aggregates RouteWaypoint features via the routeWaypoint association role.

NoCoincidentConsecutiveWaypoints

S421-R-3.2 — Consecutive waypoints must not be coincident (i.e. no zero-length leg).

public static IValidationRule<S421RoutePlan> NoCoincidentConsecutiveWaypoints { get; }

Property Value

IValidationRule<S421RoutePlan>

Remarks

Two consecutive waypoints sharing the same position produce a zero-length leg, which has no defined heading and cannot be sailed. Coincidence is tested with a tight tolerance (1e-9 degrees, about 0.1 mm at the equator) so that ordinary floating-point round-trip does not trigger the rule.

RouteEditionNumberPositive

S421-R-6.1 — When present, the route edition number must be strictly positive.

public static IValidationRule<S421RoutePlan> RouteEditionNumberPositive { get; }

Property Value

IValidationRule<S421RoutePlan>

Remarks

Spec reference: S-421 Annex A "Route" (FC) — routeEditionNo is the author-assigned edition counter. The S-100 lifecycle treats edition 1 as the first publishable edition; values of 0 or below are not meaningful.

WaypointLatLonInRange

S421-R-4.1 — Every waypoint's position must fall within the valid WGS-84 ranges: latitude in [-90, +90] and longitude in [-180, +180].

public static IValidationRule<S421RoutePlan> WaypointLatLonInRange { get; }

Property Value

IValidationRule<S421RoutePlan>

Remarks

Spec reference: S-100 Part 10b §6.2 — geographic coordinates for EPSG:4326 are bounded.

Methods

Validate(S421RoutePlan, ValidationContext?)

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

public static ValidationReport Validate(S421RoutePlan plan, ValidationContext? context = null)

Parameters

plan S421RoutePlan
context ValidationContext

Returns

ValidationReport