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

Authors

  • Mohammad Hafiz Ismail Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 02600 Arau, Perlis, Malaysia
  • Tajul Rosli Razak Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 40450 Shah Alam, Selangor, Malaysia
  • Mohd Faris Mohd Fuzi Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 02600 Arau, Perlis, Malaysia

Keywords:

Reverse geocoding, spatial indexing, Balltree, Web API, Edge Computing

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, namely 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.

Author Biographies

Mohammad Hafiz Ismail, Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 02600 Arau, Perlis, Malaysia

mohammadhafiz@uitm.edu.my

Tajul Rosli Razak, Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 40450 Shah Alam, Selangor, Malaysia

tajulrosli@uitm.edu.my

Mohd Faris Mohd Fuzi, Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA, 02600 Arau, Perlis, Malaysia

farisfuzi@uitm.edu.my

Downloads

Published

2026-09-29

Issue

Section

Articles