Use of Haversine Formula in Finding Distance Between Temporary Shelter and Waste End Processing Sites

One way to handle waste of garbage problems can be done by determining the location of any Temporary Shelters that can be visited first. To determine this, it is necessary to find the distance between the location where the driver is located and which Temporary Shelter is available. This study aims to find the distance between the location of drivers and Temporary Shelters using the Haversine formula that can produce a distance between two points on the surface of the globe. The study was conducted by taking the location of drivers and Temporary Shelters in the form of coordinate points, calculating the distance between the points where drivers and Temporary Shelters are located, and comparing the results of distances obtained. The results of the study are a list of drivers and Temporary Shelters’ distances from the smallest order. With the selection of visits from the closest distance first, it is expected that drivers can save costs and travel time taken to visit all Temporary Shelters and end up at Waste End Processing Sites.


Introduction
Waste problems are a common problem in modern society especially for residents of big cities. The rapid growth of the population accompanied by increasing consumption activities has resulted in an increasing volume of waste. Various ways are done in dealing with waste problems, one of which is to provide Temporary Shelter that is easily accessible by the community to dispose of household waste. The garbage collected at these Temporary Shelters will later be taken by the garbage fleet to be transported to the Final Processing Site. Each relevant office has its own policies in determining the collection of waste from several Temporary Shelters to the landfill. One of them is the policy of the Department of Environment and Hygiene in Palembang that determines the collection of garbage at Temporary Shelters located on primary roads to be carried out first compared to Temporary Shelters located on secondary roads with considerations to reduce congestion that may arise with the presence of transport fleets when it is loading garbage on the road.
The accuracy of the route by determining which Temporary Shelters to visit can also affect the volume of waste that can be transported per day. With a volume of waste that is unpredictable in each Temporary Shelters, the garbage transport fleet can travel repeatedly to the landfill to put the garbage This study tries to provide an alternative solution to determine which Temporary Shelters can be visited first by comparing the distance of the driver to the other Temporary Shelters that become his responsibility. The locations of Temporary Shelters and Final Processing Site are obtained using Global Positioning System (GPS) technology to obtain Temporary Shelters' and Final Processing Sites' coordinates. The distance between the two coordinate points will be calculated using the Haversine formula by processing the latitude and longitude data of the two coordinate points. The results of calculating distances using Haversine formula to determine the nearest location have 100% accuracy for the problems in previous studies [1] and the memory required to perform calculations is relatively small [2].
The objective to be achieved in this research is to build a system that can calculate the distance between the location of the driver and the Temporary Shelter, compare it to several other Temporary Shelters that are his responsibility, and provide a list of the order of the distance from the closest distance.

Related Works
There are several previous studies that used the Haversine formula to find distances from two coordinate points. The research conducted by Nguyen and Szymanski used the Haversine formula to calculate the shortest distance between two geographical coordinates [3]. The geographical coordinates of this study are check-in locations carried out by users on the Gowalla social networking site. Other research uses the Haversine formula to find the distance between the location of the user and facilities located adjacent to the user [4][5] [6] and to collect road data in the form of names, lengths, conditions, and types of roads [7]. The results of these four studies are mapping the location digitally using OpenStreetMap or Google Map.
In the Fargas and Petersen study [8], the Haversine formula is used to calculate the Mean Absolute Localization Error (MALE) by comparing the distance (error) between two coordinates, one by one, then calculating the average of the total error distance in the dataset.
The use of Haversine formula to calculate distances was further developed by Aprilinda et al. so it's not only limited to calculating the distance between two points. The study also gave results in the form of estimated travel time taken and the number of bus passengers needed [9]. Another study was conducted by Liere who used Haversine formula to establish patterns of Twitter users spreading information through retweeting based on the user's geographical location [10], and Alam et al. use Haversine formula to determine the radius of the location to count visitors at an event [11].

Haversine Formula
Haversine formula is a method used to calculate the distance from one place to the destination [12]. Haversine formula calculates the distance between 2 points based on the length of the straight line between the two points on the longitude and latitude [13]. Haversine formula is commonly used in navigation problems because it can provide a large circle distance between two points on the surface of the globe regardless of the height of the hill and the depth of the valley on the surface of the earth [14].
Calculations on haversine formula [15] use the difference or magnitude of changes in latitude (Δlat) and longitude (Δlong) two coordinate points in radians. From the two equations above, we calculate the distance between two points using the formula in Equation (3).

(3)
Where R in Equation (3) is the radius of the earth which is 6371 km [16].

Result and Discussion
The Temporary Shelters used as an example in this discussion was the Temporary Shelters in Palembang. From the relevant offices, data about vehicles and its driver obtained along withTemporary Shelters that become his responsibility and scope of work (see Table 1). Driver can choose where his current location is by activating GPS technology which will automatically save data in the form of latitude and longitude of the driver's location. When the driver location was detected (Lat: -2,954299, Long: 104,748283), and needed to find the distance between the location of his current location and Temporary Shelter located in Pasar KM 5, the first thing to do was find the difference between its latitude and longitude in radians. The value of 1 degree latitude/longitude in radians is 0,0174532925 [17]. Calculation of the distance using the Haversine formula is done for each Temporary Shelters those is in the Temporary Shelter list of the driver (Table 2). Results from distance calculation can be done for ranking based on the desired criteria. For example, if it is ranked according to the distance of the Temporary Shelter closest to the current location of the driver, then the Temporary Shelters list will be sorted from the order of the smallest distance ( Figure  1).

Figure 1. Display of Temporary Shelter List Based On Shortest Distance Order
From the sequence of distances, the driver can determine which Temporary Shelter can be visited first.
The order of distances generated by using the Haversine formula is the same as the order of distance traveled through the path that is passed on the Google Maps application ( Figure 2). a b c

Conclussion and Future Work
This study only discusses the acquisition of distance from one point to another in the form of a large circle of distance between two points on the surface of the globe based on longitude and latitude. The accuracy of calculating the distance on the surface of the globe compared to the actual distance that the driver must pass through the road is not taken into account. However, from several tests conducted by taking several sample Temporary Shelters and drivers in the city of Palembang, the list of Temporary Shelters generated by sorting them from the closest distance is the same. The results of this study produced distances between two locations, both from the current location of the driver and the location of the Temporary Shelter, the location of a Temporary Shelter with other Temporary Shelters, and the location of the polling station with a Waste End Processing Site. The resulting distance can be used as a weight for the edge value on a graph with the location of the driver, Temporary Shelters, and Waste End Processing Sites as the node. In the next study, a technique or method can be applied that can find the shortest track distance from the current driver's location, visiting all Temporary Shelters, and end up at the Waste End Processing Site.