EncDotNet.S100.Datasets.S131 0.16.0

dotnet add package EncDotNet.S100.Datasets.S131 --version 0.16.0
                    
NuGet\Install-Package EncDotNet.S100.Datasets.S131 -Version 0.16.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EncDotNet.S100.Datasets.S131" Version="0.16.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EncDotNet.S100.Datasets.S131" Version="0.16.0" />
                    
Directory.Packages.props
<PackageReference Include="EncDotNet.S100.Datasets.S131" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EncDotNet.S100.Datasets.S131 --version 0.16.0
                    
#r "nuget: EncDotNet.S100.Datasets.S131, 0.16.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EncDotNet.S100.Datasets.S131@0.16.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EncDotNet.S100.Datasets.S131&version=0.16.0
                    
Install as a Cake Addin
#tool nuget:?package=EncDotNet.S100.Datasets.S131&version=0.16.0
                    
Install as a Cake Tool

EncDotNet.S100.Datasets.S131

Reader and Lua portrayal pipeline for IHO S-131 Marine Harbour Infrastructure datasets (GML encoding, S-100 Part 10b).

Specification editions

Asset Edition Notes
Feature Catalogue 1.0.0 31 feature types, 14 information types
Portrayal Catalogue 2.0.0 42 Lua scripts, 6 SVG symbols
GML Application Schema 1.0.0 Namespace http://www.iho.int/S131/1.0

Screenshot

S-131 Halifax Harbour sample rendered in the S-100 Viewer:

S-131 Halifax Harbour

Architecture — GML + Lua hybrid

S-131 is unique in this codebase: it combines GML data encoding (like S-122, S-124, S-125, S-127, S-128, S-411, S-421) with Lua portrayal (like S-101). All other GML products use XSLT portrayal; all other Lua products use ISO 8211 or HDF5 encoding. S-131 is the first GML+Lua hybrid.

The bridge architecture:

S-131 GML → S131DatasetReader → S131Dataset
                                    ↓
                             S131LuaDataProvider (GML→Lua Host API)
                                    ↓
                             S131LuaRuleExecutor (MoonSharp Lua 5.2)
                                    ↓
                             DrawingInstructionParser (reused from S-101)
                                    ↓
                             VectorPipeline → MapsuiDisplayListRenderer

Key design decisions

  • Custom S131DatasetProcessor: Does not extend GmlDatasetProcessorBase (which hardwires XSLT). Instead follows the S101DatasetProcessor pattern with Lua infrastructure.
  • Numeric ID mapping: GML string IDs (gml:id) are mapped to sequential numeric IDs for the Lua Host API contract.
  • Synthetic spatial records: GML embeds geometry inline; the data provider synthesizes spatial association structures compatible with S-101's HostGetSpatialData contract.
  • FC-driven discrimination: Feature vs. information type classification uses a set of known information type codes from the Feature Catalogue, handling S-131's unified <S131:members> container (no <member>/<imember> split).

GML shape

<S131:Dataset xmlns:S131="http://www.iho.int/S131/1.0"
              xmlns:S100="http://www.iho.int/s100gml/5.0">
  <S131:members>
    
    <S131:Berth gml:id="f1">...</S131:Berth>
    <S131:ContactDetails gml:id="info1">...</S131:ContactDetails>
  </S131:members>
</S131:Dataset>

Public API

Type Description
S131Dataset Parsed dataset model (features + information types)
S131Feature Feature with geometry, attributes, complex attributes, xlink refs
S131InformationType Information type with attributes and xlink refs
S131DatasetReader GML parser; namespace-driven feature recognition
S131LuaDataProvider GML-to-Lua Host API bridge; owns the GML-specific spatial shim and emits EmittedInstructions
S131LuaRuleExecutor Thin ILuaVectorRuleExecutor wrapping the Core LuaRuleExecutor (Part 9A); supplies the S-131 provider factory and the TwoShades context-parameter binding
S131PortrayalCatalogue Portrayal catalogue (symbols, palettes, rules)
DataModel.S131HarbourInfrastructureDataset Typed projection of S131Dataset (see below)

Typed DataModel

The EncDotNet.S100.Datasets.S131.DataModel namespace provides a "Pass 2" strongly-typed projection layered on top of the raw S131Dataset graph, following the same pattern used by the other GML-encoded products (S-122 / S-124 / S-125 / S-127 / S-128 / S-129 / S-201 / S-411 / S-421). The projection is independent of portrayal — the Lua pipeline continues to consume the raw feature graph unchanged.

Entry point

var raw = S131Dataset.Open("dataset.gml");
var typed = S131HarbourInfrastructureDataset.From(raw, out var diagnostics);

foreach (var berth in typed.LayoutFeatures.Where(l => l.Kind == S131LayoutKind.Berth))
    Console.WriteLine($"{berth.Id}: {berth.Geometry.Points.FirstOrDefault()}");

foreach (var authority in typed.Authorities)
    Console.WriteLine($"{authority.Id} → contact={authority.ContactDetails?.Id}");

Family hierarchy

Concrete feature types are grouped into four families derived statically from the FC supertype graph (FC Ed 1.0.0 §B.2 / §B.5). The projection does not walk the FC at runtime — schema introspection remains the job of the Feature Catalogue reader.

Family Typed record Enum FC supertype
HarbourInfrastructure S131HarbourInfrastructure S131HarbourInfrastructureKind HarbourPhysicalInfrastructure (Bollard, Dolphin, DryDock, FloatingDock, Gridiron, HarbourFacility, LockBasin, LockBasinPart, MooringBuoy, OnshorePowerFacility, ShipLift, StraddleCarrier, AutomatedGuidedVehicle)
Layout S131LayoutFeature S131LayoutKind Layout (AnchorBerth, AnchorageArea, Berth, BerthPosition, DockArea, DumpingGround, FenderLine, HarbourAreaAdministrative, HarbourAreaSection, HarbourBasin, MooringWarpingFacility, OuterLimit, PilotBoardingPlace, SeaplaneLandingArea, Terminal, TurningBasin, WaterwayArea)
Metadata S131MetadataFeature S131MetadataKind Standalone (DataCoverage, QualityOfNonBathymetricData, SoundingDatum, TextPlacement, VerticalDatumOfData)
Unknown S131OtherFeature Forward-compat catch-all

Information-type hierarchy

Typed record Source code(s) Notes
S131Authority Authority Container; resolves contactDetails / applicability xlinks to typed peers via shortcut properties
S131ContactDetails ContactDetails
S131Applicability Applicability
S131AvailablePortServices AvailablePortServices
S131Entrance Entrance
S131ServiceHours ServiceHours
S131NonStandardWorkingDay NonStandardWorkingDay
S131SpatialQuality SpatialQuality
S131RxNInformation NauticalInformation / Recommendations / Regulations / Restrictions Discriminated by S131RxNKind; mirrors the FC AbstractRxN subtree
S131OtherInformationType Forward-compat catch-all

Information types in S-131 never carry geometry; the S131Authority shortcuts (ContactDetails, Applicability) are typed for the common Authority-binding pattern.

Geometry

S131Geometry wraps the four parallel coordinate collections on S131Feature into a single record with GeometryType (None, Point, Curve, Surface). Coordinates are GeoPosition(Latitude, Longitude) in decimal degrees per S-100 Part 10b §6.2.

Cross-references

xlink:href references on role-bearing child elements (e.g. <S131:applicability xlink:href="#info1"/>) are resolved into S131ResolvedReference { Role, TargetRef, Target } entries on the ResolvedReferences property of both features and information types. Unresolved references carry a null Target plus a paired xlink.unresolved / s131.reference.dangling diagnostic.

Diagnostic codes

The projection reports issues via ProjectionDiagnostic rather than throwing (the only fatal condition is an empty source dataset):

Code Severity Meaning
xlink.unresolved Warning xlink:href target not present in the dataset (from XlinkResolver)
s131.reference.dangling Warning An S131Reference ended up with Target == null — raised at the role level for easier filtering
s131.feature.unknown Info Feature type code not in the FC enumeration — falls back to S131OtherFeature
s131.information.unknown Info Information type code not in the FC enumeration — falls back to S131OtherInformationType
s131.id.duplicate Warning Two source objects share a gml:id
attribute.parse.{int,double,bool,datetime} Warning From AttributeParser (currently unused — present for forward compatibility)

Feature Catalogue note

The typed enum lists are derived from the standalone FC at content/S131/fc/FeatureCatalogue.xml (FC Ed 1.0.0). The PC-bundled FC at content/S131/pc/.../131_FC_2.0.0.20251025.xml may contain additional codes — any divergence surfaces as s131.feature.unknown / s131.information.unknown diagnostics, and the affected objects still project cleanly as S131OtherFeature / S131OtherInformationType. The projection has no runtime FC dependency.

Usage

// Parse a dataset
var dataset = S131Dataset.Open("path/to/dataset.gml");

// Or from a stream
using var stream = File.OpenRead("dataset.gml");
var dataset = S131Dataset.Open(stream);

// Access features
foreach (var feature in dataset.Features)
{
    Console.WriteLine($"{feature.FeatureType}: {feature.Id}");
}

Validation

S131HarbourInfrastructureRules.Default is a pilot rule set of Tier-1/Tier-2 checks that run against a typed S131HarbourInfrastructureDataset. Each rule's ID traces to an S-131 or S-100 spec clause.

Rule ID Description Severity
S131-R-1.1 HarbourPhysicalInfrastructure features must have non-empty geometry (container HarbourFacility exempt). Error
S131-R-1.2 Layout features must have non-empty geometry. Error
S131-R-2.1 availableBerthingLength, when present, must be a non-negative numeric value (metres). Warning
S131-R-3.1 Every coordinate must lie within the WGS-84 lat/lon ranges (S-100 Part 10b §6.2). Error
S131-R-3.2 Surface rings must have ≥ 4 vertices and be closed (first = last). Error
S131-R-4.1 Feature and information-type gml:id values must be unique within the dataset. Error
S131-R-5.1 All xlink:href references must resolve to a peer in the dataset (covers both feature and information-type axes). Warning
S131-R-6.1 Feature and information-type codes must be declared in the S-131 Feature Catalogue. Warning
var typed = S131HarbourInfrastructureDataset.From(dataset, out _);
var report = S131HarbourInfrastructureRules.Validate(typed);
foreach (var f in report.Findings)
    Console.WriteLine($"[{f.Severity}] {f.RuleId}: {f.Message}");

Tier-3 cross-dataset rules (e.g. cross-checking Berth depths against a loaded S-102 bathymetric surface) are out of scope here; they would reach sibling datasets via ValidationContext.Services.

Dependencies

  • EncDotNet.S100.Core — GML abstractions, pipeline interfaces
  • EncDotNet.S100.Datasets.S101DrawingInstructionParser reuse
  • EncDotNet.S100.Features — Feature Catalogue decoder
  • EncDotNet.S100.Portrayals — Portrayal Catalogue types
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EncDotNet.S100.Datasets.S131:

Package Downloads
EncDotNet.S100.Datasets.Pipelines

Per-spec IDatasetProcessor implementations, the DatasetPipelineFactory (file -> processor detection), the headless image-render capability, the S-98 interoperability authority, and the validation runner for IHO S-100 product datasets. Consumed by the EncDotNet.S100 convenience package, the viewer, and the s100 CLI.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.16.0 96 6/8/2026