Table of Contents

Class S57ObjectCatalogue

Namespace
EncDotNet.S57
Assembly
EncDotNet.S57.dll

Looks up S-57 object classes and attributes by code or acronym in an object catalogue.

public sealed class S57ObjectCatalogue
Inheritance
S57ObjectCatalogue
Inherited Members

Remarks

An S-57 data set encodes object classes (OBJL) and attributes (ATTL) as numbers. The product the data set belongs to decides which catalogue gives those numbers their meaning. Use For(S57ProductIdentity) or For(S57DataSetIdentification) to choose the catalogue for a data set's product (or GetObjectCatalogue() and GetObjectCatalogue()), or use one of the built-in catalogues directly:

  • Iho: the IHO S-57 Edition 3.1 Object Catalogue (Appendix A).
  • InlandEnc: the IHO catalogue plus the Inland ENC classes and attributes, codes 17000 and up.
  • Aml10, Aml21 and Aml30: the IHO catalogue plus the NATO Additional Military Layers (AML) classes and attributes of AML 1.0, 2.1 and 3.0, codes 20000 and up.

A catalogue holds codes, acronyms, names, attribute types and enumerated values. It doesn't hold definitions or the attributes each class may carry. The built-in catalogues are built the first time they're used.

Properties

Aml10

Gets the AML 1.0 catalogue: the Iho catalogue plus the object classes and attributes of the UKHO AML Object and Attribute Catalogue v1.1.6, codes 20000 and up.

public static S57ObjectCatalogue Aml10 { get; }

Property Value

S57ObjectCatalogue

Remarks

The IHO catalogue supplies the standard codes that AML 1.0 data sets use, such as C_ASSO and attribute 189 (PUNITS). Codes that the AML catalogue lists as obsolete aren't included.

Aml21

Gets the AML 2.1 catalogue: the Iho catalogue plus the object classes and attributes of the UKHO AML Object and Attribute Catalogue for AML 2 and 2.1 (v2.3.3), codes 20000 and up.

public static S57ObjectCatalogue Aml21 { get; }

Property Value

S57ObjectCatalogue

Remarks

Codes that the AML catalogue lists as obsolete aren't included.

Aml30

Gets the AML 3.0 catalogue: the Iho catalogue plus the feature types and attributes of the UKHO AML Feature and Attribute Catalogue v3.0.1, codes 20000 and up, including those AML 3.0 adds from 40101.

public static S57ObjectCatalogue Aml30 { get; }

Property Value

S57ObjectCatalogue

Remarks

The AML 3.0 catalogue doesn't give permitted primitives, so Primitives is None for its classes.

Attributes

Gets every attribute in the catalogue.

public IReadOnlyCollection<S57AttributeDefinition> Attributes { get; }

Property Value

IReadOnlyCollection<S57AttributeDefinition>

Iho

Gets the IHO S-57 Edition 3.1 Object Catalogue.

public static S57ObjectCatalogue Iho { get; }

Property Value

S57ObjectCatalogue

Remarks

It holds the object classes and attributes of S-57 Edition 3.1, Appendix A, including those added by its supplements, such as ARCSLN and CAT_TS.

InlandEnc

Gets the Inland ENC catalogue: the Iho catalogue plus the Inland ENC object classes and attributes, codes 17000 and up.

public static S57ObjectCatalogue InlandEnc { get; }

Property Value

S57ObjectCatalogue

Remarks

The Inland ENC entries give codes, acronyms, names and attribute types. They don't include the enumerated values of Inland ENC attributes, so Values is empty for them.

Name

Gets the catalogue name, for example IHO S-57 Edition 3.1.

public string Name { get; }

Property Value

string

ObjectClasses

Gets every object class in the catalogue.

public IReadOnlyCollection<S57ObjectClassDefinition> ObjectClasses { get; }

Property Value

IReadOnlyCollection<S57ObjectClassDefinition>

Methods

For(S57DataSetIdentification)

Chooses the catalogue for a data set from its identification field.

public static S57ObjectCatalogue For(S57DataSetIdentification identification)

Parameters

identification S57DataSetIdentification

The data set's identification (DSID) field.

Returns

S57ObjectCatalogue

The catalogue For(S57ProductIdentity) chooses for its Product.

Exceptions

ArgumentNullException

identification is null.

For(S57ProductIdentity)

Chooses the catalogue for a data set's product.

public static S57ObjectCatalogue For(S57ProductIdentity product)

Parameters

product S57ProductIdentity

The data set's product, from Product.

Returns

S57ObjectCatalogue

InlandEnc for InlandEnc; an AML catalogue for Aml; otherwise, Iho.

Remarks

An AML data set's catalogue follows the major number of its product specification edition (Version): 1 gives Aml10, 2 gives Aml21 and 3 gives Aml30.

When the edition is missing or has another major number, the AML product decides: the integrated product (Integrated), which only AML 3.0 defines, gets Aml30, and the separate products get Aml21, the last edition that defines them.

GetAttribute(int)

Gets the attribute with the specified code.

public S57AttributeDefinition? GetAttribute(int code)

Parameters

code int

The attribute code (ATTL).

Returns

S57AttributeDefinition

The attribute, or null when the catalogue has no attribute with that code.

GetAttribute(string)

Gets the attribute with the specified acronym.

public S57AttributeDefinition? GetAttribute(string acronym)

Parameters

acronym string

The attribute acronym, for example COLOUR. The match is case-sensitive.

Returns

S57AttributeDefinition

The attribute, or null when the catalogue has no attribute with that acronym.

Exceptions

ArgumentNullException

acronym is null.

GetObjectClass(S57ObjectCode)

Gets the object class with the specified code.

public S57ObjectClassDefinition? GetObjectClass(S57ObjectCode code)

Parameters

code S57ObjectCode

The object class code (OBJL).

Returns

S57ObjectClassDefinition

The object class, or null when the catalogue has no class with that code.

GetObjectClass(int)

Gets the object class with the specified code.

public S57ObjectClassDefinition? GetObjectClass(int code)

Parameters

code int

The object class code (OBJL).

Returns

S57ObjectClassDefinition

The object class, or null when the catalogue has no class with that code.

GetObjectClass(string)

Gets the object class with the specified acronym.

public S57ObjectClassDefinition? GetObjectClass(string acronym)

Parameters

acronym string

The object class acronym, for example LIGHTS. The match is case-sensitive.

Returns

S57ObjectClassDefinition

The object class, or null when the catalogue has no class with that acronym.

Exceptions

ArgumentNullException

acronym is null.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryGetAttribute(int, out S57AttributeDefinition?)

Tries to get the attribute with the specified code.

public bool TryGetAttribute(int code, out S57AttributeDefinition? attribute)

Parameters

code int

The attribute code (ATTL).

attribute S57AttributeDefinition

The attribute, or null when the catalogue has no attribute with that code.

Returns

bool

true when the attribute was found; otherwise, false.

TryGetAttribute(string, out S57AttributeDefinition?)

Tries to get the attribute with the specified acronym.

public bool TryGetAttribute(string acronym, out S57AttributeDefinition? attribute)

Parameters

acronym string

The attribute acronym, for example COLOUR. The match is case-sensitive.

attribute S57AttributeDefinition

The attribute, or null when the catalogue has no attribute with that acronym.

Returns

bool

true when the attribute was found; otherwise, false.

Exceptions

ArgumentNullException

acronym is null.

TryGetObjectClass(int, out S57ObjectClassDefinition?)

Tries to get the object class with the specified code.

public bool TryGetObjectClass(int code, out S57ObjectClassDefinition? objectClass)

Parameters

code int

The object class code (OBJL).

objectClass S57ObjectClassDefinition

The object class, or null when the catalogue has no class with that code.

Returns

bool

true when the object class was found; otherwise, false.

TryGetObjectClass(string, out S57ObjectClassDefinition?)

Tries to get the object class with the specified acronym.

public bool TryGetObjectClass(string acronym, out S57ObjectClassDefinition? objectClass)

Parameters

acronym string

The object class acronym, for example LIGHTS. The match is case-sensitive.

objectClass S57ObjectClassDefinition

The object class, or null when the catalogue has no class with that acronym.

Returns

bool

true when the object class was found; otherwise, false.

Exceptions

ArgumentNullException

acronym is null.