EncDotNet.S100.Datasets.S124
0.25.1
dotnet add package EncDotNet.S100.Datasets.S124 --version 0.25.1
NuGet\Install-Package EncDotNet.S100.Datasets.S124 -Version 0.25.1
<PackageReference Include="EncDotNet.S100.Datasets.S124" Version="0.25.1" />
<PackageVersion Include="EncDotNet.S100.Datasets.S124" Version="0.25.1" />
<PackageReference Include="EncDotNet.S100.Datasets.S124" />
paket add EncDotNet.S100.Datasets.S124 --version 0.25.1
#r "nuget: EncDotNet.S100.Datasets.S124, 0.25.1"
#:package EncDotNet.S100.Datasets.S124@0.25.1
#addin nuget:?package=EncDotNet.S100.Datasets.S124&version=0.25.1
#tool nuget:?package=EncDotNet.S100.Datasets.S124&version=0.25.1
EncDotNet.S100.Datasets.S124
EncDotNet.S100.Datasets.S124 reads
IHO S-124 Navigational
Warnings datasets: GML files (S-100 Part 10b) that carry NAVAREA, coastal and
local warnings. It parses a dataset into features and information types,
projects it into a typed model, validates it, and loads the S-124 portrayal
catalogue. Reference it when you need typed access to S-124 warnings or their
validation rules. To open and render any product, including S-124, use the
EncDotNet.S100 package, which includes this
one.
Install
dotnet add package EncDotNet.S100.Datasets.S124
Read a dataset
Open the dataset, then project it into the typed model:
using EncDotNet.S100.Datasets.S124;
using EncDotNet.S100.Datasets.S124.DataModel;
var dataset = S124Dataset.Open("path/to/navwarn.gml");
var warning = S124NavigationalWarning.From(dataset, out var diagnostics);
var msi = warning.Preamble?.MessageSeriesIdentifier;
Console.WriteLine($"Warning {msi?.WarningNumber}/{msi?.Year} ({msi?.ProductionAgency})");
Console.WriteLine($" Area: {warning.Preamble?.GeneralArea}");
foreach (var part in warning.Parts)
{
Console.WriteLine($" Part {part.Id}: restriction {part.Restriction}");
Console.WriteLine($" {part.WarningInformation}");
foreach (var area in part.AffectedAreas)
Console.WriteLine($" affected area {area.Id} ({area.GeometryKind})");
}
foreach (var diagnostic in diagnostics)
Console.WriteLine(diagnostic);
Main types
S124Dataset: the parsed dataset, with its features, information types and dataset identification.Opentakes a path or a stream.ReadMetadata(static, for a path or stream, or on an open dataset) returns the declared product specification and the WGS 84 extent of the feature geometry without running portrayal. The extent isnullwhen no feature has geometry.S124Feature: a feature with its type code, geometry, simple attributes, complex attributes andxlink:hrefreferences (GmlReference).S124ComplexAttributeholds a complex attribute's sub-attributes. The geometry kind is the sharedS100GeometryTypeenum fromEncDotNet.S100.Core.S124InformationType: an information type without geometry, such asNavwarnPreamble.S124NavigationalWarning: the typed model. See Typed data model.S124NavigationalWarningRules: the validation rule set. See Validate.S124PortrayalCatalogue: anIVectorPortrayalCataloguethat loads the catalogue's XSLT rules, symbols, line styles, area fills and colour palettes.
The reader extracts the features NavwarnPart, NavwarnAreaAffected and
TextPlacement.
Typed data model
S124Dataset is a feature bag: attributes are strings keyed by code, and
references are unresolved. The EncDotNet.S100.Datasets.S124.DataModel
namespace projects it into typed objects:
S124NavigationalWarning.From(dataset, out diagnostics)builds the typed graph, rooted at the warning. It resolvesxlink:hrefreferences and parses values.S124NavwarnPreamblehas a typedMessageSeriesIdentifier(warning number, year and production agency), the general area, locality, title, NAVAREA and NAVTEX values, and promulgating authority.S124NavwarnParthas the restriction code, the warning text, geometry, and the resolvedAffectedAreasandTextPlacements.S124AffectedAreaandS124TextPlacementare the features reached through the feature catalogue associationsareaAffectedandTextAssociation.S124WarningReferencehas the reference category and message reference.S124SpatialQualityhas the quality-of-position code.
Each object keeps attributes the model doesn't read in its ExtraAttributes
dictionary, so extension and later-edition attributes aren't lost. Unresolved
xlinks, values that don't parse and duplicate preambles become
ProjectionDiagnostic entries (from EncDotNet.S100.DataModel) instead of
exceptions. From throws only when the dataset has no features and no
information types.
Validate
S124NavigationalWarningRules, in the
EncDotNet.S100.Datasets.S124.Validation namespace, is the default rule set for
the typed model. It's built on the validation types in the
EncDotNet.S100.Validation namespace. Rule IDs have the form S124-R-{clause}
and trace to the S-124 Edition 1.0.0 Feature Catalogue, or to S-100 Part 10b for
shared encoding rules. The EncDotNet.S100 package's dataset.Validate() runs
the same rule set.
using EncDotNet.S100.Datasets.S124;
using EncDotNet.S100.Datasets.S124.DataModel;
using EncDotNet.S100.Datasets.S124.Validation;
var dataset = S124Dataset.Open("path/to/navwarn.gml");
var warning = S124NavigationalWarning.From(dataset, out _);
var report = S124NavigationalWarningRules.Validate(warning);
foreach (var finding in report.Findings)
Console.WriteLine($"[{finding.Severity}] {finding.RuleId}: {finding.Message}");
| Rule ID | Severity | Checks |
|---|---|---|
S124-R-1.1 |
Error | The warning contains at least one NavwarnPart. |
S124-R-2.1 |
Error | The warning includes a NavwarnPreamble. |
S124-R-2.2 |
Error | messageSeriesIdentifier has a positive warning number and a plausible year. |
S124-R-3.1 |
Error | NAVAREA is one of the IMO NAVAREA codes (I to XXI). |
S124-R-4.1 |
Error | All coordinates are within the WGS 84 latitude and longitude ranges. |
S124-R-4.2 |
Error | Surface exterior rings are closed and have at least four positions. |
S124-R-5.1 |
Warning | Each NavwarnPart has non-empty warning text. |
S124-R-6.1 |
Error | A References information type that sets referenceCategory includes messageReference. |
The rules check one dataset at a time. Cross-dataset checks, such as resolving
the warning that a cancellation refers to, aren't included. Projection
problems, such as a duplicate preamble, are reported in the diagnostics from
From, not as findings.
Portrayal
The S-124 dataset processor in EncDotNet.S100.Datasets.Pipelines converts an
S124Dataset to S-100 Part 9 FeatureXML with the shared
GmlFeatureXmlSource<TFeature> from EncDotNet.S100.Core, then runs the
bundled S-124 portrayal catalogue's XSLT rules over it. There's no
S-124-specific FeatureXML source type.
See also
- Loading datasets: open files, folders, ZIPs
and exchange sets through the
EncDotNet.S100package. - Reading product data: features, information types and typed models for each product.
- Typed data models: the typed root for each product and the shared diagnostic codes.
- Custom catalogues and validation: run the bundled rules and add your own.
| Product | Versions 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. |
-
net10.0
- EncDotNet.S100.Core (>= 0.25.1)
- EncDotNet.S100.Portrayals (>= 0.25.1)
-
net8.0
- EncDotNet.S100.Core (>= 0.25.1)
- EncDotNet.S100.Portrayals (>= 0.25.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EncDotNet.S100.Datasets.S124:
| 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.