Real Time Train Monitoring using Google Maps

Recently, there are many train accidents occurred in Indonesia where train collision contributes most of the causes. PT Kereta Api Indonesia (KAI) as state-owned enterprise that is responsible in monitoring train movement has not implemented a real time monitoring system. Thus, the current monitoring system relies on radio communication between train stations and train driver. In this paper, we propose a system to assist PT KAI to monitor train activities in a real time fashion. The system is implemented on a web based application. This web-based monitoring application equipped with complete station and train data in Java and Sumatra Islands. All trains latitude and longitude positions are retrieved through an embedded GPS device on train and the longitude and latitude data are then submitted to database server. At the server, the data is displayed in Google Maps accessible to authorized users. With this real time train monitoring system, PT KAI can track all train positions simultaneously. Therefore, the operating trains can be notified should a train collision potential is detected. Thus, the safety of rail passengers will be more assured. Keywords GPS Device, Google Maps, PT. KAI, Train Monitoring.


AbstractRecently, there are many train accidents occurred in Indonesia where train collision contributes most of the causes. PT Kereta Api Indonesia (KAI) as state-owned enterprise that is responsible in monitoring train movement has not implemented a real time monitoring system. Thus, the current monitoring system relies on radio communication between train stations and train driver.
In this paper, we propose a system to assist PT KAI to monitor train activities in a real time fashion.The system is implemented on a web based application.This web-based monitoring application equipped with complete station and train data in Java and Sumatra Islands.All trains latitude and longitude positions are retrieved through an embedded GPS device on train and the longitude and latitude data are then submitted to database server.At the server, the data is displayed in Google Maps accessible to authorized users.With this real time train monitoring system, PT KAI can track all train positions simultaneously.Therefore, the operating trains can be notified should a train collision potential is detected.Thus, the safety of rail passengers will be more assured.
Keywords GPS Device, Google Maps, PT.KAI, Train Monitoring.

I. INTRODUCTION 1
rain has been a major transportation system due to its accessibility and ability to provide rapid mass transportation.As the number of passengers increase, the train services have also adjusted to this circumstances.The increase of train services, brings many advantages and challenges to perform.This can be proven by the classic problems of train accidents and train delays.According to Indonesia national transportation safety committee, in 2010, the train accidents has the most severe impact killing 42 lives [1].Then the government has done significant effort to overcome this disaster.Among the efforts is to increase the safety assurance by maintaining the train regularly with high standard.
However, the current system has not cover train monitoring in a real time fashion.This can be crucial should the Train Company would like to improve costumer satisfactory level, as well as the safety.The customers often have to wait in the station long enough for the train without being informed about the train whereabouts.A research conducted by Djanali et.al.[2, 3] built a system to solve the above problems.To anticipate train crash, this system can provide a warning system to the train driver should there be a potential clash.Thus, the train driver can prevent potential accidents between trains by slowing down the train.He can also inform the nearest station or the opposite train to avoid the accident.This system can also be used to overcome the second problem that is the train delays.This system will keep the train passengers intact by providing current position information of his train and estimate arrival time at the station.So that passengers can predict when they should drive to the station and how long they should wait for the train.This is done by providing notification to passengers via sms when the train is about to arrive at the station.Another way to obtain the information is to access the train web where the real time locations of operating trains are presented.1 Supeno Djanali, Ary M. Shiddiqi, Hudan Studiawan, and Henning T. Ciptaningtyas are with Departement of Informatics Engineering, Faculty of Information Technology, Institut Teknologi Sepuluh Nopember, Surabaya, 60111, Indonesia.E-mail: supeno@its.ac.id.

II. METHOD This research is developed based on Djanali et. al. [2]
In order to obtain longitude and latitude of the train, a device must be installed in a train and set to operate when the train is at service.The device is also equipped with gsm modem to deliver the longitude and latitude tag produced by GPS to be sent to server [4].The server is then performing calculation for each data received.The caculation is used to find out should there any potential collision.On the other hand, this data can also be used to inform the passengers awaiting at closest stations.
The formula used to calculate distance is Cosine-Haversine Formula [5].This formula is used to calculate the great-circle distance between two points that states distance of the two points over the earth's surface.
The Haversine formula is shown below.where φ is latitude, λ is longitude, R is earth's radius (mean radius = 6,371km) Through this approach, it can be obtained the distance from the currently running train to the next closest station.).

III. SYSTEM DESIGN
This subection explains the system architecture of the train monitoring system.The system works as shown in Figure 1.
The figure shows that the process starts by creating variables for longitude and latitude container.Then, while the system is running, the system tags longitude and latitude of te train.This data is then sent to the server.At the server, this system calculates the distance of the current train with other trains and stations.This can identify should there are potential clash between trains.Beside calculating potential accidents between trains, this data is also used to inform passengers about their train.This information helps to prevent the passengers for being late catching the train.The information is broadcasted through a website and sms.
This research enhances the website by providing a more detailed longitude and latitude of stations and rail routes.The data was extracted from openstreetmap.org using osmfilter applicaion.The data extracted is in the T form of .osm,therefore it needs to be converted into the .kmlform.The .kml form is then used to create map overlay on Google Maps [6].
Furthermore, the data is divided in accordance with Regional Operations (DAOP) from PT KAI.Currently, there are DAOP 1 to 9 in Java island.Thus, this research provides 9 .kmlfiles to display on Google Maps for monitoring purpose.Figure 2 shows an example of data in an XML file from which stations imported from openstreetmap.org To add an icon on a block of XML, an additional procedure lines are added as shown in Figure 3. Train data is processed and represented in .csv(comma separated value) file format to make it easier to be displayed on website.A train data is also divided into nine according to the number of DAOP.An example of csv file that stores train name and its tracks are shown in Figure 4.In the csv file, there are four stored value each line, i.e. the ID, name of the car, the original station, and station purposes.For instance, ID "0108-01" means the first two digits are the original DAOP that is "01" means DAOP 1, the second digit is DAOP purpose is the "08" means DAOP 8.While the last two digits are the number of massage.
The railway line is also depicted in Google Maps.To illustrate this, a style feature Type:"transit.line" is added.The result is shown at Figure 5.

IV. EXPERIMENT
There are 9 DAOP options to be monitored on monitoring website.When one DAOP is selected, it will display all trains in the DAOP region.Having selected one of the trains, the map will show the current position of the train.The position of this train will be updated per second.As a result, the PT KAI can monitor all trains positions that are operating.The monitoring page views could be seen at Figure 6.
On the train monitoring website, there are nine DAOPs to choose.When one DAOP selected, it will display all trains operating in the chosen DAOP.This is done using JSON query [7].Having selected one of the trains, the map will show the final position of the train.The position of this train will be updated per second.This mechanism operates for all trains at the same DAOP.As a result, the PT KAI can monitor all operating train positions.The monitoring page views can be seen in Figure 7.
When a station icon is clicked, it will display information of its longitude and latitude, and station name.While a station is symbolized as a static icon, a train is represented by a blinking icon.This is meant to differentiate a train from a station.This mechanism is shown in Figure 8.
Real time train position data is taken from the database every second.The data in the database obtained from a device embedded in a train which sends train coordinate continuously.In the research, an android-based device was used to send the data.
Train data along with its start and end route can be displayed by selecting name of the train at the checkbox on the DAOP menu.The menu is shown in Figure 9.