EncDotNet.S100.Datasets.S57
0.17.0
See the version list below for details.
dotnet add package EncDotNet.S100.Datasets.S57 --version 0.17.0
NuGet\Install-Package EncDotNet.S100.Datasets.S57 -Version 0.17.0
<PackageReference Include="EncDotNet.S100.Datasets.S57" Version="0.17.0" />
<PackageVersion Include="EncDotNet.S100.Datasets.S57" Version="0.17.0" />
<PackageReference Include="EncDotNet.S100.Datasets.S57" />
paket add EncDotNet.S100.Datasets.S57 --version 0.17.0
#r "nuget: EncDotNet.S100.Datasets.S57, 0.17.0"
#:package EncDotNet.S100.Datasets.S57@0.17.0
#addin nuget:?package=EncDotNet.S100.Datasets.S57&version=0.17.0
#tool nuget:?package=EncDotNet.S100.Datasets.S57&version=0.17.0
EncDotNet.S100.Datasets.S57
Reader and S-101 translator for IHO S-57 Electronic Navigational Chart (ENC) datasets.
Overview
This library reads S-57 (Edition 3.1) ENC base cells via the
EncDotNet.S57 NuGet package
(itself layered on top of EncDotNet.Iso8211) and translates the parsed
records into the S-101 in-memory document model so the existing S-100 Part 9A
Lua portrayal pipeline (provided by EncDotNet.S100.Datasets.S101) can render
them. This is not an S-52 implementation — symbology is whatever the S-101
portrayal catalogue produces when fed the translated data.
Mappings follow the IHO S-57 to S-101 Conversion Guidance (S-101PT6 INF02A, draft 2021).
Key types:
S57Dataset— entry point; opens a.000file and exposes the parsedEncDotNet.S57.S57Documentfrom the upstream package, plus a staticIsS57File(path)discriminator used byEncDotNet.S100.Datasets.Pipelinesto disambiguate.000files that could otherwise be S-101.S57ToS101Translator— translates anS57Document(package type) into anS101Documentby remapping object/attribute codes, exploding multi-point soundings, synthesising theinformationcomplex attribute from textual fields, and converting nodes/edges/area-rings into S-101 spatial primitives.S57S101Mapping— embedded code-mapping table sourced from IHO's S-57 → S-101 conversion guidance.S101AllowedEnumValues— lazy-loaded helper that consults the bundled S-101 Feature Catalogue to drop emitted enumerated attribute values that aren't permitted by the destination FC binding.
Translation behaviour
| Aspect | Notes |
|---|---|
| Object/attribute codes | Looked up via the embedded S57S101Mapping rules (S-57 numeric code → S-101 acronym/code). Unknown S-57 attribute codes pass through; unknown enumerated values are dropped if the S-101 FC declares an allowable list. |
Multi-point soundings (SOUNDG) |
Exploded into S-101 MultiPoint spatial records and a Sounding feature so each depth value is independently portrayable. |
INFORM / TXTDSC (English) |
Carried as a single S-101 information complex attribute instance with text and/or fileReference and language = "eng". |
NINFOM / NTXTDS (national language) |
Carried as a separate information instance with empty language (S-57 has no language tag; Data Producers can populate it post-conversion). |
| Spatial relationships | S-57 vector pointer records (VRPT, FSPT) translated to S-101 spatial associations and ring orientation. |
Limitations
- Base cells only. Update files (
.001,.002, …) are not applied; the reader rejects them with a clear error. - Breadth-first feature coverage. Most common feature classes map to S-101 acronyms; uncommon classes pass through unmapped and may not portray.
- Listed-value remapping is best-effort. Some S-57 enumerated attribute values have different numeric codes in S-101; values that aren't permitted by the destination S-101 FC binding are silently dropped.
- Complex-attribute synthesis is minimal. Sector lights and similar features that require S-101 nested complex attributes may not portray correctly.
informationis emitted directly on the feature (per the "generally" path in the conversion guidance) rather than via a separateNauticalInformationinformation type with anAdditional Informationassociation.
Validation
S57DatasetProcessor.Validate() runs validation in two phases:
- Pre-translation —
S57PreTranslationRules.Defaultchecks the rawEncDotNet.S57.S57Documentfor things that don't survive translation (DSID / DSPM presence and a positive compilation scale; the presence of anM_COVRmeta-feature). - Post-translation — the translated S-101 document is fed into
S101DatasetRules.Default(the same pack that runs against native S-101 datasets) and the resulting findings are rebadged with the prefixS101-as-S57/so the user can tell whether a problem originated in the raw S-57 input or in the translated S-101 projection.
Pre-translation rules shipped by S57PreTranslationRules.Default:
| Rule id | Severity | Checks |
|---|---|---|
S57-R-1.1 |
Error | DSID record present AND DSPM compilation scale denominator (CSCL) > 0. |
S57-R-1.2 |
Warning | At least one M_COVR meta-feature is present in the cell. |
S57-PROJ-PARSE |
— | Placeholder reserving the namespace for future parser-diagnostic findings. |
The two reports are concatenated by ConcatReports.Concat(pre, post, rebadgePrefix: "S101-as-S57/") in
EncDotNet.S100.Datasets.Pipelines
and cached on the processor.
Exchange-set integrity verification
S57ExchangeSetVerification integrity-verifies an S-57 / S-63 exchange
set (a folder containing a CATALOG.031) and maps the result onto the
same S-100 ExchangeSetVerificationResult
model used for native S-100 exchange sets, so both products surface
uniformly through the CLI (s100 validate) and any future viewer wiring.
using EncDotNet.S100.Datasets.S57;
using EncDotNet.S100.ExchangeSets;
ExchangeSetVerificationResult result =
await S57ExchangeSetVerification.VerifyAsync("/path/to/s57set");
bool integrity = result.IntegrityVerified; // no CRC mismatches / missing files
bool signed = result.AllValid; // strict: every file signature Ok
It is a deliberately thin adapter, not a shared interface: the
upstream S-57 verifier (EncDotNet.S57 0.5.0+) is rooted at a directory
path (CATALOG.031 plus the files it references), whereas the S-100
verifier is IAssetSource-based. Forcing both behind one interface would
distort both, so only the result is mapped.
Mapping notes:
- Outcomes are mapped by name (
S57VerificationOutcome→VerificationOutcome). The two enums are kept byte-identical; mapping by name means a future divergence fails loudly rather than silently mis-mapping. - Both the signature dimension (
Outcome) and the checksum dimension (ChecksumOutcome) are preserved independently. - S-57 integrity uses a CRC-32 (the
CATALOG.031field), not the SHA-256 digest the S-100 model carries, so the per-file CRC values are surfaced throughFileVerificationResult.DetailandComputedSha256is leftnull. - The verdict semantics match S-100:
NoChecksum/NotSignedare non-failing (an unsigned-but-intact set hasIntegrityVerified == truebutAllValid == false); onlyChecksumMismatch/FileMissing/Error/ invalid signatures fail integrity. This is identical to the upstream S-57AllValid. - Today the upstream S-57 verifier reports every file as
NotSigned(S-63 signature verification is a seam); CRC checking is fully wired.
Exchange-set cell enumeration
S57ExchangeSetCatalog is the loading-side companion to the verification
adapter above. It reads a CATALOG.031 (via EncDotNet.S57's
S57CatalogReader) and groups the catalogued CATD files into renderable
base cells, each with its in-set sequential updates and (optionally) its
extent:
using EncDotNet.S100.Datasets.S57;
IReadOnlyList<S57ExchangeSetCell> cells =
S57ExchangeSetCatalog.ReadBaseCells("/path/to/s57set");
foreach (S57ExchangeSetCell cell in cells)
{
// cell.RelativePath → "…/US5MA1BO.000" (platform-normalised)
// cell.UpdateRelativePaths → ["…/US5MA1BO.001", "…/US5MA1BO.002"]
// cell.BoundingBox → EPSG:4326 extent, or null
}
BoundingBox? union = S57ExchangeSetCatalog.UnionBoundingBox(cells);
Files are grouped by their 8-character cell name; the .000 file is the base
and .001, .002, … are its updates in application order. Non-dataset
entries (.TXT, certificates, the catalogue itself) are ignored, and update
files with no matching base are skipped. The pure grouping logic is exposed as
SelectBaseCells(S57Catalog) for unit testing without a real catalogue on
disk. The viewer pairs this enumeration with a FileSystemAssetSource rooted
at the exchange-set directory so each cell flows through the same
S57DatasetProcessor code path as a single dropped .000 file (with its
in-set updates folded in via S57Document.ApplyChanges before translation to
S-101).
Like the verification adapter, this is a deliberately thin adapter over the directory-rooted S-57 model rather than a shared interface.
Usage
using EncDotNet.S100.Datasets.S57;
using EncDotNet.S100.Datasets.S101;
var s57 = S57Dataset.Open("US5NY16M.000");
var s101Document = new S57ToS101Translator().Translate(s57);
var dataset = S101Dataset.FromDocument(s101Document);
// Use the existing S-101 pipeline from here:
// S101LuaRuleExecutor, S101FeatureGeometryProvider, etc.
Installation
dotnet add package EncDotNet.S100.Datasets.S57
| 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.Iso8211 (>= 0.5.0)
- EncDotNet.S100.Datasets.S101 (>= 0.17.0)
- EncDotNet.S100.ExchangeSets (>= 0.17.0)
- EncDotNet.S100.Specifications (>= 0.17.0)
- EncDotNet.S57 (>= 0.5.0)
-
net8.0
- EncDotNet.Iso8211 (>= 0.5.0)
- EncDotNet.S100.Datasets.S101 (>= 0.17.0)
- EncDotNet.S100.ExchangeSets (>= 0.17.0)
- EncDotNet.S100.Specifications (>= 0.17.0)
- EncDotNet.S57 (>= 0.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EncDotNet.S100.Datasets.S57:
| 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.