Class S57DocumentReader
Provides methods to read S-57 Electronic Navigational Chart (ENC) files.
public static class S57DocumentReader
- Inheritance
-
S57DocumentReader
- Inherited Members
Remarks
S-57 is the IHO (International Hydrographic Organization) standard for the transfer of digital hydrographic data. ENC files are encoded using ISO 8211 format.
This reader parses the ISO 8211 encoded data and constructs an S-57 document model containing features, vectors (spatial objects), and associated metadata. The reader uses the Data Descriptive Record (DDR) to understand field structures rather than assuming a fixed binary layout.
Methods
Read(byte[], ILogger?)
Reads an S-57 document from a byte array.
public static S57Document Read(byte[] data, ILogger? logger = null)
Parameters
databyte[]The S-57 data to read.
loggerILoggerAn optional logger for reporting parsing warnings.
Returns
- S57Document
The parsed S-57 document.
Read(Stream, ILogger?)
Reads an S-57 document from a stream.
public static S57Document Read(Stream stream, ILogger? logger = null)
Parameters
streamStreamThe stream containing S-57 data.
loggerILoggerAn optional logger for reporting parsing warnings.
Returns
- S57Document
The parsed S-57 document.
Read(ReadOnlySpan<byte>, ILogger?)
Reads an S-57 document from a span of bytes.
public static S57Document Read(ReadOnlySpan<byte> data, ILogger? logger = null)
Parameters
dataReadOnlySpan<byte>The S-57 data to read.
loggerILoggerAn optional logger for reporting parsing warnings.
Returns
- S57Document
The parsed S-57 document.
ReadAsync(Stream, ILogger?, CancellationToken)
Asynchronously reads an S-57 document from a stream.
public static Task<S57Document> ReadAsync(Stream stream, ILogger? logger = null, CancellationToken cancellationToken = default)
Parameters
streamStreamThe stream containing S-57 data.
loggerILoggerAn optional logger for reporting parsing warnings.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<S57Document>
A task that represents the asynchronous read operation.
ReadFromFile(string, ILogger?)
Reads an S-57 document from a file.
public static S57Document ReadFromFile(string path, ILogger? logger = null)
Parameters
pathstringThe path to the S-57 file.
loggerILoggerAn optional logger for reporting parsing warnings.
Returns
- S57Document
The parsed S-57 document.
ReadFromFileAsync(string, ILogger?, CancellationToken)
Asynchronously reads an S-57 document from a file.
public static Task<S57Document> ReadFromFileAsync(string path, ILogger? logger = null, CancellationToken cancellationToken = default)
Parameters
pathstringThe path to the S-57 file.
loggerILoggerAn optional logger for reporting parsing warnings.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<S57Document>
A task that represents the asynchronous read operation.