Clustering Number
Clustering Number
Purpose
This note defines the two-digit Numeric Suffix used to group related survey records that may not be consecutive in the point-number sequence.
Source Priority
- HAPI User Manual.pdf
- HAPI Quick Start Guide.pdf
- Point Code and Style Code.md
Definition
A Clustering Number is a two-digit Numeric_Suffix appended after a Feature_Code. It establishes an explicit logical link between related survey points.
Syntax
FeatureCode + ClusteringNumber
Examples:
| Code | Meaning |
|---|---|
KX01 | Kerb Bottom cluster 01. |
KC01 | Kerb Bottom curve point in cluster 01. |
FB02 | Flower Bed polygon cluster 02. |
Business Rules
Preserve Leading Zeroes
The clustering token should be treated as a string token, not merely an integer.
01 ≠ visually equivalent to 1 for diagnostic and grouping traceability
Linear Features
For LINEAR features, a Clustering Number overrides default sequential grouping. All points sharing the same Feature Code and Clustering Number are connected into a single continuous feature, even if interrupted by unrelated Point Codes.
Polygonal Features
For POLYGON features, a Clustering Number changes the behaviour from rectangular calculation to irregular polygon enclosure. All points sharing the same Feature Code and Clustering Number are grouped into one polygonal feature.
Feature Separation
A change in Clustering Number explicitly separates features even if the Feature Code remains the same.
Examples
| Records | Result |
|---|---|
KX01, KX01, G1, KX01 | One continuous KX feature, ignoring the G1 interruption. |
KX01, KX02 | Two separate KX features. |
FB01, FB01, FB01, FB02, FB02 | Two separate polygon clusters. |
Implementation Notes
Preferred planned functions:
ResolveClusteringNumberGroupLinearRecordsByClusterGroupPolygonRecordsByClusterBuildClusterKey
A stable grouping key should include at least:
FeatureCode + ClusteringNumber
For curve-aware linear features, the grouping key may need to resolve straight and curve variants into a common base identity.
Related Notes
Open Questions
- Confirm whether cluster grouping should use raw Feature Code variants (
KXandKC) or resolved base feature identity for curve-capable features.