Table of Contents

Class S101AllowedEnumValues

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

Lookup of allowable enumerate values per S-101 simple attribute, derived from the bundled S-101 Feature Catalogue.

public sealed class S101AllowedEnumValues
Inheritance
S101AllowedEnumValues
Inherited Members

Remarks

The IHO "S-57 to S-101 Conversion Guidance" (Edition 0.0.1, January 2021) repeatedly states, against many feature classes, that "Values populated in S-57 for these attributes other than the allowable values will not be converted across to S-101" — pointing at S-101 DCEG clauses for the per-feature allowable lists.

This helper enforces a strict baseline: any S-57 value mapped to an S-101 enumerate-typed attribute must appear in that attribute's ListedValues. The S-101 FC's listed values are a superset of any per-feature DCEG drop set, so anything failing this check is definitely invalid in S-101 regardless of feature class. Per-feature DCEG drop sets (further restricting the allowed values for a specific feature class) are out of scope here and may be layered on top later.

Non-enumerate attributes (real, integer, text, date, …) and unknown attribute codes are treated as unconstrained and pass through.

Properties

Default

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

public static S101AllowedEnumValues Default { get; }

Property Value

S101AllowedEnumValues

Methods

ForSpec(string)

The allowable-value 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 S101AllowedEnumValues ForSpec(string catalogueSpec)

Parameters

catalogueSpec string

The product whose bundled Feature Catalogue to use.

Returns

S101AllowedEnumValues

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 S101AllowedEnumValues FromFeatureCatalogue(FeatureCatalogue catalogue)

Parameters

catalogue FeatureCatalogue

Returns

S101AllowedEnumValues

IsAllowed(string, string)

Returns true if value is an allowable code for the S-101 simple attribute named s101AttributeCode.

public bool IsAllowed(string s101AttributeCode, string value)

Parameters

s101AttributeCode string
value string

Returns

bool

Remarks

Returns true for any attribute that is not enumerate-typed or is not present in the bundled FC, so non-enum attributes pass through unchanged.

IsEnumerated(string)

Returns true if the named S-101 attribute is enumerate-typed (i.e. carries a closed list of allowable codes).

public bool IsEnumerated(string s101AttributeCode)

Parameters

s101AttributeCode string

Returns

bool