03_Core_ConceptsFeature Code

Feature Code

Purpose

This note defines the Feature Code as the primary identity token inside a Point_Code.

Source Priority

  1. HAPI User Manual.pdf
  2. FeatureCatalogue.json
  3. Feature Catalogue Specification.md
  4. Old implementation Markdown notes

Definition

A Feature Code is the alphabetical identifier that categorises the surveyed feature and determines its baseline processing behaviour.

Examples include:

Feature CodeFeature NameTypical Feature Type
KXKerb BottomLINEAR
KCKerb Bottom curve indicator variantLINEAR
CPCatch PitPOLYGON / sizing-capable symbol route
FBFlower BedPOLYGON
TETree1POINT
STNControl Station1POINT with survey-control handling

Relationship to Point Code

The Point Code begins with a Feature Code. Optional suffixes may then modify behaviour:

KX01G
│ │└─ Supplementary Suffix
│ └── Clustering Number
└──── Feature Code with Segment Type Indicator

Relationship to Feature Catalogue

The Feature_Catalogue uses FeatureCode as the primary key for looking up:

  • feature name
  • Feature_Type
  • CSWP class
  • colour code
  • level and label requirements
  • block names
  • Feature Line styles
  • ECM object availability
  • default Style Code options

Business Rules

  1. Feature Code resolution must happen before drafting routing.
  2. Unknown or unsupported Feature Codes should not be silently guessed.
  3. Drafting properties should be queried from the Feature_Catalogue rather than hard-coded in script logic.
  4. Feature Code and Feature_Type are related but not identical; the code is identity, while the type is routing behaviour.

Implementation Notes

Preferred planned functions:

  • ResolveFeatureCodeToken
  • QueryFeatureCatalogue
  • ValidateFeatureCode
  • GetFeatureType

If a code has straight and curve variants, the parser should preserve both:

Parsed FieldExample
FeatureCodeKX
IsCurveSegmentFalse
FeatureCodeKC or resolved base KX, depending on implementation policy
IsCurveSegmentTrue

The exact resolution policy for curve variants should be explicit and consistent across the engine.

Open Questions

  • Confirm whether PythonNet3 should store curve variants as their raw Feature Code (KC) or resolve them to a base Feature Code (KX) plus IsCurveSegment = True.
Built with LogoFlowershow