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
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
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
Methods
ReadCatalog(string, ILogger?)
Reads the CATALOG.031 file from the exchange set.
public S57Catalog ReadCatalog(string rootPath, ILogger? logger = null)
Parameters
rootPathstringThe absolute path to the root directory of the exchange set.
loggerILoggerAn optional logger for reporting parsing warnings.
Returns
- S57Catalog
The parsed catalog.
Exceptions
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
rootPathstringThe absolute path to the root directory of the exchange set.
loggerILoggerAn optional logger for reporting parsing warnings.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<S57Catalog>
A task that represents the asynchronous read operation.
Exceptions
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
rootPathstringThe absolute path to the root directory of the exchange set.
loggerILoggerAn 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
rootPathstringThe absolute path to the root directory of the exchange set.
loggerILoggerAn optional logger for reporting parsing warnings.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
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
rootPathstringThe absolute path to the root directory of the exchange set.
loggerILoggerAn 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
rootPathstringThe absolute path to the root directory of the exchange set.
loggerILoggerAn optional logger for reporting parsing warnings.
cancellationTokenCancellationTokenA 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
rootPathstringThe absolute path to the root directory of the exchange set.
trustAnchorsS63TrustAnchorOptionsOptional S-63 trust anchor options (currently unused).
loggerILoggerAn optional logger for reporting verification warnings.
cancellationTokenCancellationTokenA 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.