Table of Contents

Class S57ExchangeSetCatalog

Namespace
EncDotNet.S100.Datasets.S57
Assembly
EncDotNet.S100.Datasets.S57.dll

Enumerates the renderable base cells of an S-57 / S-63 exchange set by reading its CATALOG.031 via the upstream EncDotNet.S57 catalogue reader and grouping the catalogued files into base-cell + update sets.

public static class S57ExchangeSetCatalog
Inheritance
S57ExchangeSetCatalog
Inherited Members

Remarks

This is the loading-side companion to S57ExchangeSetVerification (which is verification-only): both are deliberately thin adapters over the directory-rooted S-57 model rather than a shared interface. 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.

The catalogue's CATD records reference files by an exchange-set relative path that conventionally uses backslashes (S-57 Appendix B.1); these are normalised to the running platform's separator here. Non-cell entries (text files, the catalogue itself, certificates, README files) are ignored.

Fields

CatalogueFileName

The S-57 / S-63 exchange-set catalogue filename, matched case-insensitively.

public const string CatalogueFileName = "CATALOG.031"

Field Value

string

Methods

ReadBaseCells(string)

Reads the CATALOG.031 at rootPath (a directory containing it, or the catalogue file itself) and returns its base cells.

public static IReadOnlyList<S57ExchangeSetCell> ReadBaseCells(string rootPath)

Parameters

rootPath string

The exchange-set root directory (the folder that contains CATALOG.031), or the path to the CATALOG.031 file.

Returns

IReadOnlyList<S57ExchangeSetCell>

The base cells discovered in the catalogue.

Exceptions

ArgumentException

rootPath is null or empty.

FileNotFoundException

No CATALOG.031 was found.

ResolveCataloguePath(string)

Resolves the absolute path to the CATALOG.031 file given either the exchange-set root directory or the catalogue file path itself.

public static string ResolveCataloguePath(string rootPath)

Parameters

rootPath string

A directory containing CATALOG.031, or the file itself.

Returns

string

The absolute path to the catalogue file.

Exceptions

FileNotFoundException

No CATALOG.031 was found.

SelectBaseCells(S57Catalog)

Groups the catalogue's CATD entries into base cells and their ordered updates. Exposed (rather than private) so the grouping/normalising logic can be unit-tested directly against an in-memory S57Catalog without a real CATALOG.031 on disk.

public static IReadOnlyList<S57ExchangeSetCell> SelectBaseCells(S57Catalog catalogue)

Parameters

catalogue S57Catalog

The parsed catalogue.

Returns

IReadOnlyList<S57ExchangeSetCell>

The base cells, in ascending cell-name order, each with its updates in ascending update-number order.

Exceptions

ArgumentNullException

catalogue is null.

UnionBoundingBox(IEnumerable<S57ExchangeSetCell>)

Returns the EPSG:4326 union of every cell's BoundingBox, ignoring cells that lack one. Returns null when no cell declared an extent.

public static BoundingBox? UnionBoundingBox(IEnumerable<S57ExchangeSetCell> cells)

Parameters

cells IEnumerable<S57ExchangeSetCell>

The cells to union.

Returns

BoundingBox

Exceptions

ArgumentNullException

cells is null.