Table of Contents

Class S101FeatureAttributeBindings

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

Lookup of which S-101 feature classes directly bind a given (complex or simple) attribute, derived from the attribute bindings declared on each feature type in the bundled S-101 Feature Catalogue.

public sealed class S101FeatureAttributeBindings
Inheritance
S101FeatureAttributeBindings
Inherited Members

Remarks

The S-57 → S-101 translation assembles several S-101 complex attributes (for example rhythmOfLight and the date-range complexes fixedDateRange / periodicDateRange / surveyDateRange) from flat S-57 attributes. A complex attribute may only be emitted on a feature whose Feature Catalogue entry actually binds it; emitting it on any other feature would be non-conformant. Because the same S-57 attribute pair (e.g. PERSTA/PEREND) is only meaningful where the destination complex is bound, this lookup gates the assembly on the resolved S-101 feature class.

Only direct attribute bindings are indexed. The bundled S-101 FC denormalises bindings onto concrete feature types (for example rhythmOfLight is listed on LightAllAround rather than on an abstract light super-type), so super-type inheritance does not need to be resolved here.

Properties

Default

Lazily-loaded singleton built from the S-101 Feature Catalogue embedded in Specification.

public static S101FeatureAttributeBindings Default { get; }

Property Value

S101FeatureAttributeBindings

Methods

Binds(string?, string)

Returns true if the feature class (or information type) named featureCode directly binds the attribute named attributeCode in the Feature Catalogue.

public bool Binds(string? featureCode, string attributeCode)

Parameters

featureCode string
attributeCode string

Returns

bool

BindsFeatureAssociation(string?, string, string, string?)

Returns true if the feature class named featureCode may be linked, through the feature association named associationCode, to an instance of otherFeatureCode playing the role named roleCode. Both the S-101 and the S-401 catalogue, for instance, let a Bridge reach a LightAllAround as theEquipment of a StructureEquipment association.

public bool BindsFeatureAssociation(string? featureCode, string associationCode, string roleCode, string? otherFeatureCode)

Parameters

featureCode string

The feature class carrying the binding, e.g. "Bridge".

associationCode string

The feature association code, e.g. "StructureEquipment".

roleCode string

The role the other feature plays, e.g. "theEquipment".

otherFeatureCode string

The other feature class, e.g. "LightAllAround".

Returns

bool

true when the feature class declares that feature binding.

BindsInformationType(string?, string, string)

Returns true if the feature class named featureCode may be linked to an instance of the information type named informationTypeCode through the information association named associationCode. S-401, for instance, lets LockBasin reach TimeScheduleInGeneral through AdditionalInformation, but not Bridge.

public bool BindsInformationType(string? featureCode, string associationCode, string informationTypeCode)

Parameters

featureCode string

The feature class code, e.g. "LockBasin".

associationCode string

The information association code, e.g. "AdditionalInformation".

informationTypeCode string

The information type code, e.g. "TimeScheduleInGeneral".

Returns

bool

true when the feature class declares that information binding.

BindsSubAttribute(string?, string?)

Returns true if the complex attribute named complexAttributeCode declares a sub-attribute binding for the (simple or complex) attribute named attributeCode in the Feature Catalogue — for example zoneOfConfidence binds categoryOfZoneOfConfidenceInData.

public bool BindsSubAttribute(string? complexAttributeCode, string? attributeCode)

Parameters

complexAttributeCode string

The parent complex attribute code.

attributeCode string

The candidate sub-attribute code.

Returns

bool

DefinesAttribute(string?)

Returns true if the Feature Catalogue defines a simple or complex attribute named attributeCode (case-sensitive). S-401, for instance, does not define S-101's categoryOfBridge.

public bool DefinesAttribute(string? attributeCode)

Parameters

attributeCode string

The attribute code, e.g. "categoryOfBridge".

Returns

bool

DefinesFeatureType(string?)

Returns true if the Feature Catalogue defines a feature class named featureCode (case-sensitive, as feature class codes are). Lets a translation skip constructs its target product lacks, such as S-101's RangeSystem, which S-401 does not define.

public bool DefinesFeatureType(string? featureCode)

Parameters

featureCode string

The feature class code, e.g. "RangeSystem".

Returns

bool

ForSpec(string)

The feature/attribute binding lookup built from the bundled Feature Catalogue of catalogueSpec (e.g. "S-101" or "S-401"), loaded on first use and shared thereafter. Lets the S-57 translation check its output against whichever S-100 product it targets.

public static S101FeatureAttributeBindings ForSpec(string catalogueSpec)

Parameters

catalogueSpec string

The product whose bundled Feature Catalogue to use.

Returns

S101FeatureAttributeBindings

The shared lookup for that catalogue.

Exceptions

InvalidOperationException

No Feature Catalogue is bundled for catalogueSpec.

FromFeatureCatalogue(FeatureCatalogue)

Builds an instance from a parsed S-101 FeatureCatalogue.

public static S101FeatureAttributeBindings FromFeatureCatalogue(FeatureCatalogue catalogue)

Parameters

catalogue FeatureCatalogue

Returns

S101FeatureAttributeBindings

IsComplexAttribute(string?)

Returns true if the Feature Catalogue defines a complex attribute named attributeCode (case-sensitive), such as featureName or zoneOfConfidence.

public bool IsComplexAttribute(string? attributeCode)

Parameters

attributeCode string

The attribute code, e.g. "featureName".

Returns

bool

IsSingleValued(string?, string)

Returns true if the S-101 feature class named featureCode binds the attribute named attributeCode with an upper multiplicity of at most one, so a feature instance may carry at most one occurrence of it.

public bool IsSingleValued(string? featureCode, string attributeCode)

Parameters

featureCode string

S-101 feature class code (e.g. Bridge).

attributeCode string

S-101 attribute code (e.g. bridgeConstruction).

Returns

bool

true for a [0..1] or [1..1] binding; false for a multi-valued binding or when the feature does not bind the attribute.