Class S101LegacyFeatureNames
Maps legacy (pre-2.0.0) S-101 feature class names to their S-101 Edition 2.0.0 equivalents so that datasets authored against an earlier edition of the S-101 Feature Catalogue can be portrayed with the bundled Edition 2.0.0 Portrayal Catalogue.
public static class S101LegacyFeatureNames
- Inheritance
-
S101LegacyFeatureNames
- Inherited Members
Remarks
Between S-101 1.x and 2.0.0 several compound feature class names were
re-ordered (for example BuoyLateral became LateralBuoy and
BeaconCardinal became CardinalBeacon), and a few classes were
merged: the 1.x RestrictedAreaNavigational and
RestrictedAreaRegulatory classes became a single
RestrictedArea, and TrafficSeparationZone /
TrafficSeparationLine became SeparationZoneOrLine. Because the
S-100 Part 9A Lua portrayal dispatcher (main.lua) loads and invokes a
rule module whose file name and global function name both equal the
feature's class code (require(feature.Code) then
_G[feature.Code](...)), a dataset that reports a legacy class code
finds no matching 2.0.0 rule module and falls back to DEFAULT symbology.
Simple attribute names are stable across these editions, so re-mapping only the feature class name restores correct symbology. The mapping is applied at the portrayal boundary only (see S101LuaDataProvider); feature names are left as-authored everywhere else.
MooringWarpingFacility was structurally removed in S-101 2.0.0 and
split into several distinct feature classes, so it is mapped conditionally
on the legacy categoryOfMooringWarpingFacility enumerant. Categories
without a clean 2.0.0 equivalent (tie-up wall, chain/wire/cable) — and
instances with an absent or empty category — are routed to the Default
rule module so the dispatcher's require always resolves and the
feature is portrayed with DEFAULT symbology, rather than failing
require with module 'MooringWarpingFacility' not found. The
conditional category targets are approximations: only the class name is
aliased, not the attributes the 2.0.0 rule reads (for example
Dolphin.lua inspects categoryOfDolphin), so the resulting
symbology may be generic. A target rule that rejects the legacy feature's
geometric primitive simply errors inside the dispatcher's pcall and
falls back to DEFAULT — i.e. no worse than today.
References: S-101 Feature Catalogue (Edition 1.x and 2.0.0); S-100 Part 9A (Portrayal — Lua rules engine).
Methods
Normalize(string, Func<string, string?>?)
Returns the S-101 2.0.0 feature class name equivalent to
featureCode, or featureCode
unchanged when it is already a 2.0.0 name or has no clean mapping.
public static string Normalize(string featureCode, Func<string, string?>? categoryLookup = null)
Parameters
featureCodestringThe feature class code reported by the dataset (from its embedded feature-type-name catalogue).
categoryLookupFunc<string, string>Optional callback that resolves the first value of a simple attribute on the feature being normalized, used to disambiguate the removed
MooringWarpingFacilityclass viacategoryOfMooringWarpingFacility. When the category has no clean 2.0.0 mapping — or when this callback is null or returns null —MooringWarpingFacilityis routed to theDefaultrule module so itsrequirestill resolves.
Returns
- string
The normalized feature class name (a 2.0.0 feature class name, the input unchanged, or
Defaultfor a category-lessMooringWarpingFacility).