# Navigating the Maps: Euclidean vs. Road Network Distances in Spatial Queries
## 4 Results  
### Comparison of k-Nearest Neighbors Search  
This study compared the Euclidean distance method and the road network distance method for each category. The comparison was conducted by retrieving the POIs using both methods and comparing the results. For the kNN queries, if the POIs retrieved from both methods were identical, the result would be marked as 1; otherwise, it was marked as 0. This approach was applied to each classification, thereby allowing us to compute accuracy using the following formula:  
\[\text{Accuracy}_{k,c}=\frac{\sum_{i=1}^{n}\text{kNN}_{c}\times 100\%}{\text{ total cases}_{c}} \tag{2}\]  
where:  
\[k =\text{the number of k-nearest neighbors}\] \[c =\text{density category (1-5)}\]  
Each category's accuracy results were plotted and presented in Figure 16. It is interesting to observe that as the value of k increased, the classification accuracy decreased across all categories. Even for query points with the highest density of POIs, the accuracy still decreased. The results indicate that the accuracy remained high for Class One and Three, with rates above 85%, as well as for the remaining classes, which had rates exceeding 90%. This suggests that the Euclidean and road network distance methods consistently provide accurate results, particularly for the first category of points of interest. The accuracy significantly dropped for all classes except for Class Two when the number of k was set to two, thus maintaining an accuracy rate above 90%. Nevertheless, the accuracy rate for these classes remained above 70%. It appears that increasing the number of nearest neighbors beyond two further decreased the accuracy for all classes, with the accuracy dropping below 70% across the board. Figure 16: Accuracy of the Euclidean distance method using k-nearest neighbor queries for all samples. As depicted in Figure 17, the box plot offers a thorough overview of accuracy distribution while drawing attention to any data points that fall outside the typical range (outliers). It is clear that as the value of k exceeded two, the median accuracy dropped below 70% across all categories. This implies that utilizing more than two nearest neighbors results in a noticeable reduction in classification accuracy. Additionally, the presence of outliers beyond the whiskers in specific categories points to situations where the accuracy performance becomes notably poor or erratic. Analyzing Figures 16 and 17, we observe the results obtained from queries in both types of POIs. Considering the differences between two different dataset types is crucial, since the number of POIs significantly differs. The hospital dataset contains fewer data points than the ambulance dataset. Hence, the accuracy results for each value of k are expected to differ between the two datasets. By taking into account these differences, we can develop a more comprehensive insight into how dataset attributes influence the accuracy of classification outcomes. This examination enables us to uncover the nuances that distinguish the hospital dataset from the ambulance dataset, thereby offering valuable insights for future enhancements and similar analyses. Figure 18 shows line graphs that plot the  
The observation from the graph is that as the value of k increased, the hospital dataset, which has a smaller number of POIs than the ambulance dataset, tended to achieve higher accuracy results. On the other hand, the ambulance dataset, with its large number of POIs, exhibited lower accuracy results. This suggests that having a smaller number of POIs in the dataset leads to higher accuracy in some classes and some values of k-nearest neighbors when using the Euclidean distance method. Figure 18: Line graph plot with the different datasets (hospital, ambulance, and hospital and ambulance) for kNN queries. (**a**) Class 1—line graph plot with the different datasets. (**b**) Class 2—line graph plot with the different datasets. (**c**) Class 3—line graph plot with the different datasets. (**d**) Class 4—line graph plot with the different datasets.