Class S57ObjectCatalogue
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
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
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
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
Iho
Gets the IHO S-57 Edition 3.1 Object Catalogue.
public static S57ObjectCatalogue Iho { get; }
Property Value
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
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
ObjectClasses
Gets every object class in the catalogue.
public IReadOnlyCollection<S57ObjectClassDefinition> ObjectClasses { get; }
Property Value
Methods
For(S57DataSetIdentification)
Chooses the catalogue for a data set from its identification field.
public static S57ObjectCatalogue For(S57DataSetIdentification identification)
Parameters
identificationS57DataSetIdentificationThe data set's identification (
DSID) field.
Returns
- S57ObjectCatalogue
The catalogue For(S57ProductIdentity) chooses for its Product.
Exceptions
- ArgumentNullException
identificationisnull.
For(S57ProductIdentity)
Chooses the catalogue for a data set's product.
public static S57ObjectCatalogue For(S57ProductIdentity product)
Parameters
productS57ProductIdentityThe 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
codeintThe attribute code (
ATTL).
Returns
- S57AttributeDefinition
The attribute, or
nullwhen the catalogue has no attribute with that code.
GetAttribute(string)
Gets the attribute with the specified acronym.
public S57AttributeDefinition? GetAttribute(string acronym)
Parameters
acronymstringThe attribute acronym, for example
COLOUR. The match is case-sensitive.
Returns
- S57AttributeDefinition
The attribute, or
nullwhen the catalogue has no attribute with that acronym.
Exceptions
- ArgumentNullException
acronymisnull.
GetObjectClass(S57ObjectCode)
Gets the object class with the specified code.
public S57ObjectClassDefinition? GetObjectClass(S57ObjectCode code)
Parameters
codeS57ObjectCodeThe object class code (
OBJL).
Returns
- S57ObjectClassDefinition
The object class, or
nullwhen the catalogue has no class with that code.
GetObjectClass(int)
Gets the object class with the specified code.
public S57ObjectClassDefinition? GetObjectClass(int code)
Parameters
codeintThe object class code (
OBJL).
Returns
- S57ObjectClassDefinition
The object class, or
nullwhen the catalogue has no class with that code.
GetObjectClass(string)
Gets the object class with the specified acronym.
public S57ObjectClassDefinition? GetObjectClass(string acronym)
Parameters
acronymstringThe object class acronym, for example
LIGHTS. The match is case-sensitive.
Returns
- S57ObjectClassDefinition
The object class, or
nullwhen the catalogue has no class with that acronym.
Exceptions
- ArgumentNullException
acronymisnull.
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
codeintThe attribute code (
ATTL).attributeS57AttributeDefinitionThe attribute, or
nullwhen the catalogue has no attribute with that code.
Returns
- bool
truewhen 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
acronymstringThe attribute acronym, for example
COLOUR. The match is case-sensitive.attributeS57AttributeDefinitionThe attribute, or
nullwhen the catalogue has no attribute with that acronym.
Returns
- bool
truewhen the attribute was found; otherwise,false.
Exceptions
- ArgumentNullException
acronymisnull.
TryGetObjectClass(int, out S57ObjectClassDefinition?)
Tries to get the object class with the specified code.
public bool TryGetObjectClass(int code, out S57ObjectClassDefinition? objectClass)
Parameters
codeintThe object class code (
OBJL).objectClassS57ObjectClassDefinitionThe object class, or
nullwhen the catalogue has no class with that code.
Returns
- bool
truewhen 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
acronymstringThe object class acronym, for example
LIGHTS. The match is case-sensitive.objectClassS57ObjectClassDefinitionThe object class, or
nullwhen the catalogue has no class with that acronym.
Returns
- bool
truewhen the object class was found; otherwise,false.
Exceptions
- ArgumentNullException
acronymisnull.