Table of Contents

Class S57DocumentReader

Namespace
EncDotNet.S57
Assembly
EncDotNet.S57.dll

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

data byte[]

The S-57 data to read.

logger ILogger

An 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

stream Stream

The stream containing S-57 data.

logger ILogger

An 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

data ReadOnlySpan<byte>

The S-57 data to read.

logger ILogger

An 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

stream Stream

The stream containing S-57 data.

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.

ReadFromFile(string, ILogger?)

Reads an S-57 document from a file.

public static S57Document ReadFromFile(string path, ILogger? logger = null)

Parameters

path string

The path to the S-57 file.

logger ILogger

An 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

path string

The path to the S-57 file.

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.