Table of Contents

Class S57ExchangeSet

Namespace
EncDotNet.S57.ExchangeSets
Assembly
EncDotNet.S57.dll

Represents the file layout of an S-57 ENC exchange set.

public sealed record S57ExchangeSet : IEquatable<S57ExchangeSet>
Inheritance
S57ExchangeSet
Implements
Inherited Members

Remarks

An exchange set is a distribution package for S-57 chart data. It contains a CATALOG.031 catalogue file, a base cell file (with a .000 extension), and zero or more update files (with sequential extensions .001, .002, etc.).

All paths exposed by this type are relative to the root directory of the exchange set. This type describes only the file layout; it does not parse the files themselves.

Properties

BaseCellFileName

Gets the relative path to the base cell file (e.g. US5CA12M/US5CA12M.000).

public required string BaseCellFileName { get; init; }

Property Value

string

CatalogFileName

Gets the relative path to the catalogue file (e.g. CATALOG.031), or null if no catalogue is present.

public string? CatalogFileName { get; init; }

Property Value

string

UpdateFileNames

Gets the relative paths to the update files, ordered by application sequence (e.g. US5CA12M/US5CA12M.001, US5CA12M/US5CA12M.002).

public required ImmutableArray<string> UpdateFileNames { get; init; }

Property Value

ImmutableArray<string>

Methods

ReadCatalog(string, ILogger?)

Reads the CATALOG.031 file from the exchange set.

public S57Catalog ReadCatalog(string rootPath, ILogger? logger = null)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

logger ILogger

An optional logger for reporting parsing warnings.

Returns

S57Catalog

The parsed catalog.

Exceptions

InvalidOperationException

CatalogFileName is null.

ReadCatalogAsync(string, ILogger?, CancellationToken)

Asynchronously reads the CATALOG.031 file from the exchange set.

public Task<S57Catalog> ReadCatalogAsync(string rootPath, ILogger? logger = null, CancellationToken cancellationToken = default)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

logger ILogger

An optional logger for reporting parsing warnings.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<S57Catalog>

A task that represents the asynchronous read operation.

Exceptions

InvalidOperationException

CatalogFileName is null.

ReadChart(string, ILogger?)

Reads the base cell file and applies any update files in order, returning the resulting chart.

public S57Chart ReadChart(string rootPath, ILogger? logger = null)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

logger ILogger

An optional logger for reporting parsing warnings.

Returns

S57Chart

A strongly-typed chart model with all updates applied.

ReadChartAsync(string, ILogger?, CancellationToken)

Asynchronously reads the base cell file and applies any update files in order, returning the resulting chart.

public Task<S57Chart> ReadChartAsync(string rootPath, ILogger? logger = null, CancellationToken cancellationToken = default)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

logger ILogger

An optional logger for reporting parsing warnings.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<S57Chart>

A task that represents the asynchronous load operation.

ReadDocument(string, ILogger?)

Reads the base cell file and applies any update files in order, returning the resulting document.

public S57Document ReadDocument(string rootPath, ILogger? logger = null)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

logger ILogger

An optional logger for reporting parsing warnings.

Returns

S57Document

The fully updated S-57 document.

ReadDocumentAsync(string, ILogger?, CancellationToken)

Asynchronously reads the base cell file and applies any update files in order, returning the resulting document.

public Task<S57Document> ReadDocumentAsync(string rootPath, ILogger? logger = null, CancellationToken cancellationToken = default)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

logger ILogger

An optional logger for reporting parsing warnings.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<S57Document>

A task that represents the asynchronous read operation.

VerifyAsync(string, S63TrustAnchorOptions?, ILogger?, CancellationToken)

Verifies the integrity of the files referenced by this exchange set's CATALOG.031.

public Task<S57ExchangeSetVerificationResult> VerifyAsync(string rootPath, S63TrustAnchorOptions? trustAnchors = null, ILogger? logger = null, CancellationToken cancellationToken = default)

Parameters

rootPath string

The absolute path to the root directory of the exchange set.

trustAnchors S63TrustAnchorOptions

Optional S-63 trust anchor options (currently unused).

logger ILogger

An optional logger for reporting verification warnings.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<S57ExchangeSetVerificationResult>

A result enumerating per-file verification outcomes.

Remarks

This is an opt-in, non-throwing operation: it reads the catalogue and validates each entry's CRC checksum against the corresponding file on disk, returning the per-file outcomes. S-63 digital-signature verification is a seam and currently reports every file as NotSigned.

Exceptions

InvalidOperationException

CatalogFileName is null.