Style Code
Style Code
Purpose
This note defines the Style Code system used by HAPI ECM workflows.
Source Priority
- HAPI User Manual.pdf
- HAPI Quick Start Guide.pdf
- Point Code and Style Code.md
- FeatureCatalogue.json
Definition
A Style Code is a specialised descriptor used to convert real-world street furniture and surveyed features into standardised strings that explicitly describe their physical appearance.
While Point Codes define the geometric and survey-processing characteristics of survey records, Style Codes define ECM object appearance and style selection.
Core Components
| Component | Meaning | Requirement |
|---|---|---|
| Style Type Key | Primary style category of the object. | Required where an ECM style is needed. |
| Style Variant Key | Specific visual variation of the primary style. | Optional. |
| Component Key | Additional attachment, component, measurement, or metadata. | Optional. |
Standalone Style Codes
Standalone ECM objects are typically generated from 1POINT, 2POINT, or POLYGON features.
Example forms:
| Example | Interpretation |
|---|---|
FH HD-TKM | Fire Hydrant using Heavy Draw-off Hydrant style with variant/component key. |
G1 GA1-450 | Grating using type GA1 with a 450 specification. |
TE T01:12.0,3.0,0.5 | Tree number T01, height 12.0, spread 3.0, DBH 0.5. |
Linear Style Codes
Linear ECM objects represent continuous street furniture spanning multiple vertices, such as railings.
Linear Style Codes are vertex-based. They reside in the Raw Description of the COGO Point below the line vertex and define the visual style of the segment extending forward from that vertex.
| Component | Meaning |
|---|---|
| Segment Indicator | Section classification such as intermediate or terminal. |
| Component Index | Which component should be loaded for the relevant segment. |
Common segment indicators:
| Indicator | Meaning |
|---|---|
X | Intermediate section. |
T | Terminal section. |
Example forms:
| Example | Interpretation |
|---|---|
RX01 T2R-SD-T1 | Railing cluster with Type 2 Railing, Standard variant, terminal component. |
RX02 TUB-PLAIN-X1 | Tubular Railing, Plain variant, intermediate component. |
Tree Style Code
Tree (TE) Style Codes use a specialised dimensional format:
TreeNumber:Height,Spread,DBH
Examples:
| Style Code | Meaning |
|---|---|
T01:12.0,3.0,0.5 | Tree number T01, height 12.0, spread 3.0, DBH 0.5. |
TREE:12.0,3.0,0.5 | No assigned tree number, full dimensions supplied. |
TREE:12.0,3.0 | DBH omitted. |
TREE:12.0 | Spread and DBH omitted. |
TREE | No tree dimension data supplied. |
Business Rules
- Style Code is ECM-oriented; it should not replace Point Code geometry rules.
- Point Code resolves what the feature is and how it is geometrically processed.
- Style Code resolves how the feature should be represented as an ECM object.
- Linear Style Codes are vertex-based and can propagate forward until a new Style Code is encountered.
- Style Code parsing should be resilient to commas inside valid style metadata, especially for tree data.
Implementation Notes
Preferred planned functions:
ParseStyleCodeResolveStyleTypeKeyResolveStyleVariantKeyResolveStyleComponentKeyBuildStyleRecordApplyLinearStylePropagation
Style parsing should be performed after Point Code parsing and Feature Catalogue resolution.
Related Notes
Open Questions
- Confirm the complete Style Type Key dictionary and whether it should be generated directly from style JSON files.