Table of Contents

Class S122MarineProtectedAreaRules

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

The default ValidationRuleSet<TModel> of normative rules for an S-122 S122MarineProtectedAreaDataset. Rule identifiers follow the convention S122-R-{clause}, where {clause} traces to the relevant section of the S-122 product specification (FC 2.0.0) or — for clauses not cleanly attributable to a single FC element — to a locally-assigned number in the 9.x range. The XML <remarks> on each rule cites the supporting clause.

public static class S122MarineProtectedAreaRules
Inheritance
S122MarineProtectedAreaRules
Inherited Members

Remarks

This rule pack focuses on Tier-1 (schema-shape) and Tier-2 (spec-semantic) checks that can be evaluated against a single typed dataset projection in isolation. Tier-3 cross-dataset rules (e.g. cross-referencing an S-122 restricted area against an overlapping S-101 routing zone) will be added in a follow-up once Services is wired up by the MCP validate_all surface.

Rules deliberately omitted from this pack:

Properties

CoordinatesWithinWgs84Range

S122-R-4.1 — Every coordinate on every feature must lie within the valid WGS-84 ranges: latitude in [-90, +90] and longitude in [-180, +180].

public static IValidationRule<S122MarineProtectedAreaDataset> CoordinatesWithinWgs84Range { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Spec reference: S-100 Part 10b §6.2 — geographic coordinates for EPSG:4326 are bounded. The S-122 application schema inherits this constraint via its dependency on the S-100 GML profile. The S-122 instructions also remind authors that coordinate ordering in <gml:pos> is lat-lon for EPSG:4326.

Default

The canonical default rule set for S-122 datasets.

public static ValidationRuleSet<S122MarineProtectedAreaDataset> Default { get; }

Property Value

ValidationRuleSet<S122MarineProtectedAreaDataset>

GeometryPresentWhenKindSet

S122-R-3.1 — Every feature that declares a non-None geometry kind must carry at least one coordinate.

public static IValidationRule<S122MarineProtectedAreaDataset> GeometryPresentWhenKindSet { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Spec reference: S-122 FC 2.0.0 § Feature Types — a feature whose geometry primitive is Point, Curve, or Surface must have coordinates conveying that geometry. Geometry-less features (GeometryKind == None) are tolerated for container-style projections that delegate their boundary via an xlink association (see the project-level S-122 instructions, "Renderers must tolerate geometry-less features").

ProductIdentifierIsS122

S122-R-9.1 — When present, the dataset ProductIdentifier must identify the S-122 product specification (i.e. start with "S-122", case-insensitive).

public static IValidationRule<S122MarineProtectedAreaDataset> ProductIdentifierIsS122 { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Local clause numbering (9.x) — there is no single S-122 FC clause for product-identifier conformance. The check derives from the S-122 instructions file: "the S-100 <productIdentifier> element is the source of truth" for distinguishing S-122 from incorrectly-namespaced trial datasets (the official 2.0.0 sample is mis-labelled with the S-123 namespace prefix). A dataset whose product identifier does not name S-122 should not be consumed as an S-122 dataset.

ScaleMinimumPositive

S122-R-7.1 — When a feature carries a scaleMinimum attribute, the value must be a positive display-scale denominator (≥ 1).

public static IValidationRule<S122MarineProtectedAreaDataset> ScaleMinimumPositive { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Spec reference: S-122 FC 2.0.0 §scaleMinimum (inherited from the FC-abstract FeatureType). The attribute is a display scale denominator (the "S" in 1:S), so zero or negative values have no cartographic meaning. Surfaced as a warning rather than an error because some producer pipelines emit 0 as a sentinel for "no scale limit" — non-conformant but observed in the wild.

SurfaceRingClosure

S122-R-5.1 — Surface features must have a closed exterior ring with at least four coordinates (three distinct plus the closing point) and the first / last positions must coincide within a small tolerance.

public static IValidationRule<S122MarineProtectedAreaDataset> SurfaceRingClosure { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Spec reference: S-100 Part 10b §6.2.4 / OGC GML 3.2 §10.5 — gml:LinearRing is closed by definition: the first and last positions are identical. Surface features therefore require at least four coordinates (a degenerate triangle plus closure). The tolerance (1e-9 degrees, about 0.1 mm at the equator) matches the tolerance used by the S-421 pilot's coincident- waypoint rule so that ordinary floating-point round-trip does not falsely trigger this rule.

UniqueFeatureIds

S122-R-6.1 — No two features within the dataset may share the same identifier (gml:id).

public static IValidationRule<S122MarineProtectedAreaDataset> UniqueFeatureIds { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Spec reference: S-100 Part 10b §6.4 / OGC GML 3.2 §7.2.4.2 — gml:id is of XSD type ID, which requires uniqueness per XML document. Duplicate feature identifiers also break the projection's xlink resolver, since references can no longer be disambiguated.

UniqueInformationTypeIds

S122-R-6.2 — No two information types within the dataset may share the same identifier (gml:id).

public static IValidationRule<S122MarineProtectedAreaDataset> UniqueInformationTypeIds { get; }

Property Value

IValidationRule<S122MarineProtectedAreaDataset>

Remarks

Spec reference: S-100 Part 10b §6.4 / OGC GML 3.2 §7.2.4.2 — gml:id uniqueness is per XML document, spanning both features and information types. This rule covers the information-type subset; UniqueFeatureIds covers the feature subset. (We split the rule along that boundary so per-finding RelatedFeatureId remains meaningful — feature vs. info type IDs land in different result lanes in viewer / MCP consumers.)

Methods

Validate(S122MarineProtectedAreaDataset, ValidationContext?)

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

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

Parameters

dataset S122MarineProtectedAreaDataset
context ValidationContext

Returns

ValidationReport