API @ mypapit
Research Article / 2026

Design and Evaluation of a Lightweight Reverse Geocoding API for Malaysian Location-Description Retrieval Using Spatial Indexing

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.

Journal
J. Adv. Res. Comput. Appl.ISSN 2462-1927
Volume / Issue
Vol. 44, No. 1Pages 129–146
Published
29 Sep 2026Karya Ilham
Access
OpenFree PDF
01 / Corresponding
Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 02600 Arau, Perlis, Malaysia
ORCID 0000-0001-5798-4926
02
Tajul Rosli Razak
Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 40450 Shah Alam, Selangor, Malaysia
03
Mohd Faris Mohd Fuzi
Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 02600 Arau, Perlis, Malaysia
§ 01

Abstract

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.

§ 02

Keywords

  • reverse geocoding
  • spatial indexing
  • BallTree
  • Web API
  • edge computing
  • KD-Tree
  • Geohash
  • H3
  • Malaysia
  • embedded systems
§ 03

Key Findings

54,357
Location Records
100%
BallTree Baseline Agreement
0.135ms
BallTree Mean Latency
1,000
Evaluation Queries
  • F/01BallTree selected — combined low latency with complete agreement against the geographic-distance baseline; zero distance difference across all 1,000 queries.
  • F/0255% latency reduction — mean retrieval time dropped from 0.302 ms (brute-force haversine) to 0.135 ms (BallTree).
  • F/03KD-Tree also exact — matched baseline perfectly but with higher latency than BallTree.
  • F/04Geohash and H3 inexact — marginally lower latency, but produced mismatched retrievals with kilometre-scale maximum distance differences.
  • F/05Spatial grouping handles ambiguity — repeated coordinates associated with multiple descriptions are returned as candidate sets, avoiding false exact-match claims.
  • F/06Edge-ready architecture — runs locally without external API dependency, suitable for IoT gateways, embedded monitoring, and offline field deployments.
§ 04

Methods Compared

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.
§ 05

Dataset

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.

§ 06

Cite This Article

APA
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.
IEEE
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.
BibTeX
@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}
}
§ 07

Corresponding Author

Mohammad Hafiz bin Ismail is a Senior Lecturer at the Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA (UiTM), Perlis Branch, Malaysia.

His research covers geospatial systems, embedded computing, web APIs, and location-aware applications, with a focus on practical deployable systems for Malaysian operational contexts.

Read the full paper in PDF

18 pages · 2.3 MB · Open Access

Download PDF →