A practical local approach for Malaysian coordinate-to-description retrieval in embedded monitoring and location-aware systems. BallTree wins: 100% baseline agreement, sub-0.15 ms mean latency.
Reverse geocoding converts geographic coordinates into meaningful location descriptions. This study developed a lightweight local reverse geocoding API for Malaysian location-aware and embedded computing applications. The dataset contained more than 54,000 location records, including repeated coordinates associated with multiple descriptions. These records were reorganised into spatial groups so that descriptions sharing the same coordinate could be returned together. Four retrieval methods — KD-Tree, BallTree, Geohash, and H3 — were implemented and evaluated against a brute-force haversine baseline using 1,000 coordinate queries. The evaluation measured query latency, agreement with the baseline, additional retrieval distance, and index preparation time. KD-Tree and BallTree achieved 100% agreement with the baseline and recorded zero distance difference. BallTree reduced mean retrieval latency from 0.302 ms for brute-force search to 0.135 ms. Although Geohash and H3 achieved slightly lower latency, both produced mismatched retrieval results with kilometre-scale maximum distance differences. BallTree was therefore selected as the preferred method because it provided efficient retrieval while preserving complete agreement with the geographic-distance reference. The proposed API provides a practical local approach for Malaysian coordinate-to-description retrieval in embedded monitoring and location-aware systems.
| Method | Latency | Baseline Agreement | Notes |
|---|---|---|---|
| BallTree Selected | 0.135 ms | 100% / 0 m diff | Hypersphere-based partitioning. Best trade-off of speed and exactness. |
| KD-Tree Exact | Higher | 100% / 0 m diff | Binary space partitioning. Exact but slower than BallTree on this dataset. |
| Geohash Inexact | Lower | Mismatched | Base-32 prefix search. Fast, but kilometre-scale distance errors. |
| H3 Inexact | Lower | Mismatched | Uber's hexagonal hierarchical index. Same precision issues as Geohash. |
| Brute-force Baseline | 0.302 ms | — (reference) | Haversine over all groups. Reference implementation, not deployable. |
The reference dataset comprises 54,357 Malaysian location records stored as comma-separated values, with fields for State, District, Town, Latitude, Longitude, and a five-character GeoHash. Records span multiple Malaysian states, including Kedah and Selangor.
A defining characteristic of the dataset is the presence of repeated coordinates associated with multiple distinct location descriptions. Rather than collapsing these into single rows, the system groups identical spatial points and returns their associated candidate descriptions together — an honest representation of available data that avoids claiming exact address identification.
Ismail, M. H., Razak, T. R., & Fuzi, M. F. M. (2026). Design and evaluation of a lightweight reverse geocoding API for Malaysian location-description retrieval using spatial indexing. Journal of Advanced Research in Computing and Applications, 44(1), 129–146.
M. H. Ismail, T. R. Razak, and M. F. M. Fuzi, "Design and evaluation of a lightweight reverse geocoding API for Malaysian location-description retrieval using spatial indexing," J. Adv. Res. Comput. Appl., vol. 44, no. 1, pp. 129–146, 2026.
@article{ismail2026reverse,
title={Design and Evaluation of a
Lightweight Reverse Geocoding API
for Malaysian Location-Description
Retrieval Using Spatial Indexing},
author={Ismail, Mohammad Hafiz and
Razak, Tajul Rosli and
Fuzi, Mohd Faris Mohd},
journal={Journal of Advanced Research
in Computing and Applications},
volume={44}, number={1},
pages={129--146}, year={2026},
issn={2462-1927}
}
18 pages · 2.3 MB · Open Access