Data Collection for Nearest Public Facility Using Ball Tree Algorithm and Google Maps API
DOI:
https://doi.org/10.34123/icdsos.v2025i1.541Keywords:
Ball Tree, Distance Matrix, Google Maps API, AccessibilityAbstract
Accessibility to public facilities is a crucial factor in regional development, including
at the village level as the smallest administrative unit. The Central Bureau of Statistics (BPS)
currently collects data on public facilities and their distances to village offices through
interviews, making the results dependent on respondents’ perceptions. This research aims to
measure the nearest distance from village offices to public schools by utilizing the BallTree
algorithm and the Google Maps API. The dataset consists of 128 village offices and a list of
public schools classified into four categories. BallTree was used to filter the nearest school
candidates within a given radius, after which the route distance of the ten nearest candidates was
calculated using the Google Maps Distance Matrix API to identify the school with the nearest
route distance based on the road network. The findings show that straight-line distance often
aligns with route distance, although not at all, highlighting the importance of Google Maps route
calculation. This research concludes that combining BallTree and the Google Maps API
improves computational efficiency while providing objective and reliable information.