Haversine Formula and RPA Algorithm for Navigation System

The system uses a geographic information system to analyze and monitor traffic congestion and use GPS data for public transport planning in Yangon, Myanmar. The system provides accurate maps for estimating traffic conditions more efficiently from GPS data, saving more time. The proposed system displays changes in the position, distance and direction of vehicles traveling on the streets of Yangon by using traffic state and routing pattern algorithm. There established centralized GPS server database infrastructure provides any kind of analysis that requires GPS traffic data stored in a distributed clientserver environment. In this system, a statement of user desired traffic jams between the source and destination is estimated and the results are presented with a Map. This system is for analyzing traffic data, avoiding traffic congestion and obtaining optimal routes with a modified A* algorithm. GPS data (current location) and user search area using the K-d tree and Haversine algorithm are required. Second, look for traffic jam data with Google's traffic layer and the routing matrix pattern algorithm. Finally, Analysis the traffic by Smart-A* and then show the result of traffic congestion statement and best optimal route. In the case, there are three main components: Data Collection, Data Extraction and Implementation. And this is ClientServer database system that storing the data and server in the cloud Virtual Machine (VM).


Introduction
In the past times, the main intersections and points are opportune with traffic jams because the number of vehicles is so many. For these problems, A GPS Mobile application and traffic analysis system was developed that collects GPS traffic data and provides the ability to monitor traffic scenarios on the roads. The system also provides planners with road usage patterns for analysis and decision making. All of these aspects can be analyzed in real time and historically based on the fact that historical data is captured and stored for future use. This system allows you to accurately capture and analyze traffic information and segment locations. This system is focused on Yangon regions in Myanmar. As a city with more 5 million people, the traffic conditions in Yangon are very similar to other major cities around the world: crowded and congested. In Yangon city, the most used type of transport for citizens are buses. However, due to severe traffic congestion, most buses run very slowly during peak hours.
The Yangon City Development Committee (YCDC) is planning to ease traffic jams in Yangon within six months and will install modernized traffic lights in 154 places, according to the Roads and Bridges Department under the YCDC. According to the YCDC, traffic jams in Yangon will be reduced by to 30 or 40 percent after the system is implemented. This structural application uses data from the urban network in Yangon. This article aims to follow these factors. The area of traffic jams of a route from origin to destination must be indicated and traffic conditions estimated using GPS data from vehicles equipped with mobile devices for real-time and low-cost traffic data. Accurate Map Matching Results with Short Ambiguous GPS Data. And the last fact is to calculate the optimal route with data from the Geo Database and send the right results to mobile users.
This article proposes ways to analyze and monitor your traffic routing system. The proposed approach uses a smartphone. The smartphone has a GPS receiver that detects road congestion and calculates the speed of the vehicle driver with an accelerometer. Implemented by a client / server architecture. The GPS receiver can capture the position of the client user and send it to the server.
This approach can be applied to generate the traffic congestion area between the source and destination of traffic routes, real time traffic data, accurate map, and so on. You can also send accurate route information to the mobile user by creating the Geo database. The remainder of the paper is organized as follows. Section 2 presents the whork related to the proposed system. The next section, section 3, is the general steps for information on traffic routes between source and destination. In section 4, we discussed extracting precision traffic data with the KD tree. In section 5 explain the traffic congestion areas with route pattern algorithm. In section 6 addresses experiments and results. Finally, section 7 presents the conclusion. certain style, then select the appropriate name on the style menu. The style will adjust your fonts and line spacing.

Motivation for the Project
Global Positioning Service system or GPS is a relatively new technology. Although it was mainly used for military purposes at the time of invention, this technology was later used in many consumer applications. In recent years, each smartphone has been primarily equipped with Google GPS and location information services to complement and manage applications such as Google Maps. Therefore, using GPS data, people activities can be represented more accurately than ever before. As a result, in recent years we have seen a huge number of applications and usage services based on the location of the smartphone. Considering that many drivers and travelers are smartphone users, road traffic scenarios can also be proved using GPS data.
And this is consistent with the fact that even in developing countries, more and more growing people are now using GPS smartphones, which are traffic checking and avoiding system based on the concept of collecting and classifying location data. Using a specific highway to be transmitted and using this data to represent the statement of traffic condition present on a particular highway, a very practical and versatile traffic monitoring system can be provided. Therefore, the purpose of this paper is to improve a real-time traffic detecting, monitoring and avoiding framework consisting of mobile applications and back-end Web services for fast and efficient deployment in countries such as some ASEAN countries. This article also examines various traffic detect and checking systems that use similar concepts.
We will also research and develop the algorithms and workflows required for data transfer between end users and servers. In addition, we investigated possible failures and the scope of the system improvement.

Related Work
Several reports on the research of traffic monitoring systems have been submitted [1][2][3][4][5][6][7][8][9][10][11][12]. ESRI, California 92373-8100 USA [2] reported "GIS Road and Highway Management Solutions". This document introduces various methods of transport solutions, including procedural life cycle, highway asset management, maintenance and work order management, and transportation planning. In this document, the following facts can be difficult: First, buildings that integrate financial management projects and software with GIS to better manage infrastructure projects. The second is to integrate GIS into business processes to improve operational performance. Cheng Hian Goh, Hong Jun Lu [4] presented a time data index using an existing B + tree.
This article describes a data mapping strategy that allows you to use existing B + trees directly. With this implementation, temporal relationships are mapped to points in multidimensional space, with each time interval translated to two-dimensional coordinates and temporal selection operations are constructed as spatial search operations. This approach has two advantages. First, mapping temporal relationships to multidimensional spaces provides a uniform framework for dealing with temporal questions that involve valid transactions and time, as well as other non-temporal attributes.
Second, linearization of the multi-dimensional search space allows classical indexing methods (such as the B+-tree) to be used. S. AnithaSelva S. D. 1 [6] proposed Minimizing the Traffic Congestion Using GIS. The study requires a clear understanding of the flow patterns, locations, and existing road networks about the impact of the Transport System Management (TSM) steps. Geographic information systems (GIS) can be used effectively to analyze transportationrelated issues. Alfio Costanzo [9] proposes using GPS data to monitor road traffic in the metropolitan area. The proposed methodology is only needed for GPS users traveling on a city road map to periodically send these coordinates to a usertuned server as soon as they are detected. To build a traffic monitoring system, enough drivers need to send GPS data to the server during travel and calculate traffic flow in real time.
Al. Amin, MD. Rafi Uddin [10] proposed "Real-time traffic monitoring system using crowd-provided GPS data". The overall system is mainly divided into two parts, client side and server side. The client side is shaped like a mobile app, which has two main modes of functionality: the push mode and the tracking mode. The server site continues to listen to location reports from devices that require a current map view of a specific area. If a device on a specific road reports its position, it creates the coordinates and speed. The article includes comparative analysis of options in the Android ecosystem to measure the speed of the Android API and Google Maps, the development environment, the compiler and the IDE. Although the system can work even if there is only one user on a road at a given time, the greater the number of users on the road, the better the system will work. This requires encouraging many people to participate in or selectively distribute the process by forcing its use by equipping specific drivers under the supervision of a governmental organization.
In [12], this system estimates the current traffic congestion statements of user's desired area between source and destination and presents the estimated results in Map. The historical traffic condition data of each road network on each time using the pre-collected data are utilized in this research. Using the Hidden Markov (HMM) model to estimate the traffic condition states of these road networks using historical traffic data. These estimated traffic probability states are presented by coloring users' desired source and destination road segments on Google Map. And evaluate your estimation system using the data set generated by data collection from mobile phone-equipped vehicles over a period of time. 4 months in Yangon.
In this document, we propose methods for analyzing and monitoring traffic systems. The proposed approach uses a smartphone, equipped with a GPS receiver to study traffic jams and an accelerometer to calculate the speed of the driver's vehicle. This is implemented by the client / server architecture. It can acquire the position of client users with a GPS receiver and send them to the server. This approach can be applied to produce traffic congestion areas between the source and destination traffic routes, real-time traffic data, accurate maps and so on. It is also possible to send the accurate route information to mobile user by creating Geo database.

General Steps of the Reaffic Routes Information
The system displays the results of estimated traffic congestion conditions for the source and destination desired by the user. Car GPS Android devices are used to capture GPS location data, start and end points, and then transfer this data to the data center. Use a map matching algorithm to merge this data with the road network to see which vehicles are on which road networks. However, if the GPS data is not clear, the map match will be inaccurate. When the system corresponds to the road segment of the wrong vehicle, the estimation of the traffic congestion state result will be incorrect because the road conditions of each road segment are different. An algorithm is developed for generating the traffic routes information by client /server architecture. The client-side application captures the user location with GPS receiver. It is designed for android platform. The server processes the data captured by the client-side application. Four operation steps are performed in this approach.
Step (1): Collecting the GPS data for the transportation network in the urban by user current location for considering bus stops, road statements, traffic lights and other.
Step (2): Store GPS and traffic data in a spatial database. And the system retrieves the locations of latitude and longitude, speed, distance, time and direction using the KD tree.
Step (3): Detect traffic analysis using the routing pattern algorithm.
Step (4): After that, the end user receives information about the routes of mobile traffic as a client.
The system flow of the traffic monitoring system is shown in Figure 2.

Basic Requirements
Preprocessing is the process of establishing road segments data and calculating historical data from pre collected GPS trajectories data from mobile phone equipped vehicles to use in checking up to date traffic congestion statements for users' needed source and destination.
The following documents are required for our system. i. Android Studio 3.5.1 or later.
ii. The device that has Google Play Store app.
iii. Android version 5.0 or higher. iv. Google APIs configurations.

Research Area and Data Collection
The research area is Yangon City. Now, there are seven townships where currently research areas in this approach: There are Collected locations data and traffic-lights in Yangon city (33 townships). See as figure 3. These GPS data and historical traffic data are stored and extracted in the Cloud database (VM).

Historical Traffic Data
This is the list of total Traffic-Lights in Yangon city (see as Table 1.). The number of traffic-light in the whole of Yangon is 220 points. There are many points in the whole of country. But Our research area is Yangon city and we collect and analyze Traffic-Lights points in just the Yangon City. There are 220 traffic-lights as shown in the list YCDC.
And then we capture out these traffic-light data on the Map of the system. There are 220 points of road traffic-lights collected in Yangon. In these 220 of Points and 802 of Stands and 501 of LEDs.

Extracting the Traffic Data Using KD Tree
The word "data" is plural, not singular. The subscript for the permeability of vacuum µ0 is zero, not a lowercase letter "o." The term for residual magnetization is "remanence"; the adjective is "remanent"; do not write "remnance" or "remnant." Use the word "micrometer" instead of "micron." A graph within a graph is an "inset," not an "insert." The The K-d tree is a useful data structure for different applications, such as searches involving multi-dimensional search keywords (eg, interval search and close-range search). The K-d tree is a special case of partitioning binary space trees. The following is the process of creating a KD tree algorithm.
Procedure of KD tree: kdtree function (list of points pointList, depth int) {// Select an axis based on depth so that the axis passes all valid values, axis var int: = depth mod k; // List of classification points and select median as a dynamic element select the median on the pointList axis; // Create a node and build subtrees knot tree var; node.location: = median; node.leftChild: = kdtree (points in pointList before the median, depth + 1); node.rightChild: = kdtree (points in pointList after median, depth + 1); return node; } KD-Tree is a summary of binary search trees to multidimensional data. Each node of the KD tree contains a key, a distinct column, and up to two indicators for its child nodes. Traditional methods use the median of each column to divide the data level. The three elements of each level are concentrated on a specific dimension around the robin selection. Figure 4 depicts a KD tree indicating the XandY size. The root indexes the X dimension in the value of 5. The next level determines the next Y dimension in the median of the new segment defined by X. X when X < 5, otherwise 2. The aquarium with intervals X > 5 and 2 < Y < 10 is required to pass through the tree until the node (Y, 2) is reached, and the column partition is scanned from position 8 to the end.
In this article, we retrieve the user's current location with latitude and longitude, speed, time and direction from the traffic database. Subsequently, we also need to evaluate the automation method to measure the distance between the user's current location and the desired destination. An algorithm for searching traffic data by the KD tree structure is developed. Consequently, the system is more efficient than searching and quickly reduces time. The sample tree structure of the system is shows in figure 4.

Find Nearest Routes and Points with Haversine
It is Calculate the geographic distance on Earth. We can easily calculate the distance of the great circle. The system needs a point closer to the user's current location. After calculating the distance using Haversine, it releases the best route to the user's desired destination.
If we have two different latitudes -the longitude values of two different points on the earth, then with the Haversine formula, we can easily calculate the distance of the great circle. We verify the haversines law to get the equation, as shown below. As for Haversine equation, we get that: This system uses the following algorithm, modified from the Haversine formula and the A* algorithm: To complete the search for the best route while saving process time and data storing, the algorithm repeats the following steps: Algorithm ( 4. Check all current drop-down nodes to determine adjacency. 5. (Haversine d = R * c) Meanwhile, get the closest point. 6. If there are no adjacent nodes in the first-list, calculate the cost of the node and record it as the formula f = g + h.
7. Enter the cost into the first-list. 8. If the adjacent node is already in the first-list, record the cost of the current node as the previous cost. If not, change the previous node and recalculate the cost.
9. Add the start and end node costs to the last-list. 10. End the search and close the list.

Routing Pattern Algorithm
In this Section, we will consider the traffic jam usually occurs between two points of vehicle which are current GPS point (cpt) and last GPS point (lpt). It can calculate the density of traffic between any two points. The vehicle speed can be defined by routing pattern analysis as: where Vs is the speed of vehicle on the road and t is time between two GPS points. The (cpt-lpt) is the distance between two GPS points.
To accurately illustrate the routing condition, we also need to set a limit on the set of speed limits that will be correctly reflected in the database. Using summary information about the speed of traffic, you can find out the level of congestion by checking the number of updates and / or vehicles involved, as well as the speed of traffic. The vehicles used depend on the data points found in the displayed segment of the indicated road. In this paper, we have to use the routing pattern algorithm: Begin Input Initialize the list of k = 1, 2,…, k of database. Where,: Xi(t)= the state of system, k= number of neighbors, While For each I in data set: Cakculate Distance(Xi(t)) If Distance(Xi(t)) < MaxDis, between of neighborhoods, LONGEST i. Remove LONGEST ii. Find new LONGEST and MaxDis iii. Add (Xi(t)) (c) Estimate K-NN search (Xi(t)) (d) Add (Xi(t)) and record latest conditions.

Testing to Get Optimal Route Without Traffic Congestion
In this test, we assume Considering the route from Source A, to Destination B in Insein Township, Yangon. In these there are three possible routes in map: (1) Pyay-Thirimingar,  And then, we test using ATCOR application for optimal route from source A to Destination B.  Figure 6).
In this testing, the excellent result is the optimal route without traffics that this can avoid two traffic areas in the possible route than normal route. As another good advantages are this system can choice source pointes where user want to be and if user haven't need other source as for current location, that is also complete action for the optimal route. And then the system shows detail of the optimal route such as estimate time and distance between source and destination.

Experiments and Results
A few experiments have been done for monitoring the traffic jams areas in urban transportation. Computer/Laptops, GPS Devices/ GPS enabled mobile phones and GPS Server are used for our experiments. To analyze data and manipulate the traffic route areas, Android program (Android Software Development Kit) is applied. In experiments, he collects the user's current location using a GPS device, and then detects most of the traffic jams, extracting the geographical location, as shown in Table 2. Continuously, the mobile user can get the result of conditions. traffic jams on the route map, as shown in Figure 7.
Traffic jam usually occurs between two points, usually at the end points of a road. How to calculate the nearest location: The spherical cosine law (as Haversine's formula) was used to determine the nearest location, that is, the distance through SQL statements. d=R*acos(cos(latl).cos(lat2).cos(lng2lngl)+sin(latl).sin(lat2)) Where, d is the distance between two coordinates (lat 1, lng2) and (lat2, lng2) and R is the radius of the earth. (mean radius = 6,371km).  In this paper, the efficiency of proposed system is tested on the Map of Yangon Division. The system gives the information of current traffic jams areas to mobile user (see figure 8). And also, it will provide the save time, low-cost effects and can easily reach the target places in short time by going with optimal path to get the destination.

Conclusion
This system shows efficient method for Traffic Monitoring System of Yangon City in Myanmar Nation. The system estimates the traffic congestion areas of user's desired road segment of current time. Mobile phone with GPS-enabled can help their position and velocity accurately.
The system used methods that are Speed of traffic and routing pattern algorithms and Haversine methods. Software Requirements are QGIS and eclipse (JAVA), Map API and so on. Hardware Requirements are computer/Laptops GPS Devices/ GPS enabled mobile phones and GPS Server. An excellent system for storing and managing these types of data is the Geographic Information System (GIS). Access to GPS tracking data can be obtained from a mobile phone, tablet or desktop computer. View cars as they move in real time, or use the historical playback feature, which provides constant access to vehicle travel history. In the proposed system, GPS tracker devices are installed on each selected vehicle in the road network.
In the system the control server receives GPS data via GPS tracker and matching and calculate optimal route in the system to show result mobile user.
Moreover, it also provides the accurate map for more efficient estimation results for traffic state from GPS data and saving more time other. In the recent years every person uses smartphones mostly. Every smartphone come equipped with GPS to manage route applications. Thus, human activities can be represented well the result with GPS data. Users need to get the valued estimation facts (travel time, route distance and speed of vehicle) for not delaying and congest to reach their goals.
The proposed system is the most suitable method to know the areas of traffic congestion at the desired time. This system shows results of region traffic origin and destination traffic congestion states of all places of interest in Yangon using mobile phone GPS data. One of the initial motivations is people want to avoid the congestions points and better solution of real-time system for transportation.