Class S101ToS57Rules
The rule tables for S101ToS57Translator: S-101 feature classes and attributes to S-57 object classes and attributes, following S-65 Annex C (S-101 to S-57 ENC Conversion Guidance, Ed 1.0.0).
public sealed class S101ToS57Rules
- Inheritance
-
S101ToS57Rules
- Inherited Members
Remarks
Most rules are derived by inverting the forward mapping
(S57S101Mapping): every S-57 class or attribute whose default
target is an S-101 code converts back to it, and per-value remaps are
reversed. Annex C overrides follow for the cases that don't invert, such as
the classes a forward redirect reaches (Bollard → MORFAC
with CATMOR 3) and the Boolean attributes S-57 encodes as
enumerations (§2.4.2). Each rule cites the Annex C clause it follows.
Use Default, or build a variant with WithFeatureRule(S101ToS57FeatureRule) and WithAttributeRule(S101ToS57AttributeRule, string?).
Properties
AttributeRules
Attribute rules keyed by S-101 attribute code, used on any class without a class-specific rule.
public IReadOnlyDictionary<string, S101ToS57AttributeRule> AttributeRules { get; }
Property Value
Default
The rules derived from Default plus the Annex C overrides.
public static S101ToS57Rules Default { get; }
Property Value
FeatureAttributeRules
Attribute rules that apply on one S-101 feature class only, keyed by (feature class, attribute).
public IReadOnlyDictionary<(string Feature, string Attribute), S101ToS57AttributeRule> FeatureAttributeRules { get; }
Property Value
FeatureRules
Feature class rules keyed by S-101 feature class code.
public IReadOnlyDictionary<string, S101ToS57FeatureRule> FeatureRules { get; }
Property Value
Methods
Build(S57S101Mapping)
Builds the rules by inverting forward and applying the
Annex C overrides.
public static S101ToS57Rules Build(S57S101Mapping forward)
Parameters
forwardS57S101MappingThe S-57 → S-101 mapping to invert.
Returns
- S101ToS57Rules
The reverse rules.
IsS57ListAttribute(string)
Whether the S-57 attribute is of type List (comma-separated values) rather than Enumerated, per S-57 Ed 3.1 Appendix A.
public static bool IsS57ListAttribute(string s57Acronym)
Parameters
s57AcronymstringThe S-57 attribute acronym, e.g.
COLOUR.
Returns
NotConvertedClause(string, string)
The Annex C clause under which an S-101 attribute isn't converted on a
feature class: one the class's clause names, one Annex C never
converts, or (for those it doesn't name) a §2.6 enhancement; otherwise
null. Attributes a value remap drops are not included.
public static string? NotConvertedClause(string s101FeatureCode, string s101AttributeCode)
Parameters
s101FeatureCodestringThe S-101 feature or information type code.
s101AttributeCodestringThe S-101 attribute code.
Returns
ResolveAttribute(string, string)
The rule for an S-101 simple attribute on a feature class: the class-specific rule when there is one, otherwise the general rule.
public S101ToS57AttributeRule? ResolveAttribute(string s101FeatureCode, string s101AttributeCode)
Parameters
Returns
ResolveFeature(string)
The rule for an S-101 feature class, or null when it has none.
public S101ToS57FeatureRule? ResolveFeature(string s101Code)
Parameters
s101Codestring
Returns
WithAttributeRule(S101ToS57AttributeRule, string?)
Returns a copy with rule added: for one feature class
when s101FeatureCode is given, otherwise as the
general rule for its attribute.
public S101ToS57Rules WithAttributeRule(S101ToS57AttributeRule rule, string? s101FeatureCode = null)
Parameters
ruleS101ToS57AttributeRules101FeatureCodestring
Returns
WithFeatureRule(S101ToS57FeatureRule)
Returns a copy with rule added or replacing the rule for its class.
public S101ToS57Rules WithFeatureRule(S101ToS57FeatureRule rule)
Parameters
ruleS101ToS57FeatureRule