03_Core_ConceptsClustering 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

  1. HAPI User Manual.pdf
  2. HAPI Quick Start Guide.pdf
  3. 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:

CodeMeaning
KX01Kerb Bottom cluster 01.
KC01Kerb Bottom curve point in cluster 01.
FB02Flower 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

RecordsResult
KX01, KX01, G1, KX01One continuous KX feature, ignoring the G1 interruption.
KX01, KX02Two separate KX features.
FB01, FB01, FB01, FB02, FB02Two separate polygon clusters.

Implementation Notes

Preferred planned functions:

  • ResolveClusteringNumber
  • GroupLinearRecordsByCluster
  • GroupPolygonRecordsByCluster
  • BuildClusterKey

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.

Open Questions

  • Confirm whether cluster grouping should use raw Feature Code variants (KX and KC) or resolved base feature identity for curve-capable features.
Built with LogoFlowershow