March 12, 2012

Using Google Maps and Android Phones to track trains on IRCTC portal

I have been a laggard with smartphones but last month I finally bought an Android phone and within days I got a tidy return on my small investment -- two extra hours on the upper berth of an overnight train ! How ?

If you are travelling alone at night, in an AC compartment then you have no way to knowing where you are at any point in time and the need to climb down every now and then to check the station that you are passing through is painful. Instead what I did was to lie on the bunk and switch on Google Maps on my GPS enabled Android phone and watched the blue arrow that showed me (and the train) as it snaked across the countryside. Only after passing the last station before my destination, did I finally get down from bunk feeling rather smug about this new technology.

This simple technology can be used to track the movement of all trains across the entire country. How ?

Every Android phone is associated with a specific Gmail ID and using this Gmail ID one can “check-in” into “places” defined in Google Latitude. Usually these “places” are hotels, restaurants and other businesses defined by their respective owners and once someone “checks-in” into a place, this information is available to  “friends” on the Google network.

We first create a special Gmail ID to represent a specific train -- say for the Howrah Delhi Rajdhani  -- and use this ID to register an Android phone. Next we define each of the 219 stations on the Howrah-Delhi route as a “place” in Google Latitude. For this specific gmail ID,, we define these 219 stations as places where check-in is automatic. Finally, we give this phone to the guard of the the Howrah Delhi Rajdhani or tether it securely in the guard’s cabin.

Now as the train travels across the country, the Android phone will automatically check into every station that the train is passing through and anybody who defines this specific Gmail ID as a friend will know the last station where this train has checked-in and when.

The immediate benefit is that once the stations are defined as places -- and a place once defined can be used for all trains passing through -- and the Gmail ID for each train is set up, then the train running information becomes automatically available in the public domain with no further effort. Not only is the entire process automatic but it is totally free of cost except for the initial investment on the Android phones.

This automatically updated train running information will not only be a boon for passengers but also for the Indian Railways themselves as they would be able to track the position of all trains with a good deal of precision from anywhere in the country. Moreover, if this facility is extended to goods trains, then corporate shippers will be able to track their consignments if they know which train their goods are booked on.

However, there are few loose end that need to be tied up. First, one can only track a friend and to be friend, as in any social media, one’s friend request must be accepted by the target. This means that for each train id, e.g., someone must accept friend requests from anyone who wants to know where the train is -- but this can be automated as well. Second, Google Maps already identifies railway stations but does not allows people to “check-in” into them. If this is allowed then the task of defining all train stations again as business places can be done away with.

Finally and perhaps the most important is how to handle the return trip. The down train would have a different train number but since the Gmail ID with which an Android device is registered cannot be changed easily we need to have two Android phones per rake and only one, corresponding to the train number that is actually running, must be active while the other should be switched off. So a pair of rakes that support an UP and DOWN train service would need four Android phones two of which, located in different rakes, will have the same GMail ID.

The SIMRAN project of the Indian Railways has a similar goal but it needs its own dedicated hardware and software. Reportedly, the pilot project needs an investment of Rs 100 crore plus annual maintenance costs. In contrast, at Rs 7,500 per phone and four phones per pair of trains, this approach can use the free Google Maps service to track the top 100 trains in the country for an investment of Rs 30 lakhs or at 0.3% of the cost ! However if we consider a very stripped down Android phone -- no touch screen, no colour, no audio, no 4GB Micro SD memory -- the cost can go down to as little as Rs 1,000 if we consider the Akash tablet as a benchmark.

But the best solution would be adopt the philosophy of Web 2.0 and tap into user generated data -- that is use the data from the passenger’s smartphones so that the Railways have to invest nothing at all !

If a passenger has booked his ticket through the IRCTC website, then his cellphone number and his PNR number are both available with IRCTC. With the PNR number the name and scheduled destination of the train is known and if the passenger can be incentivised  -- with lotteries, loyalty points or otheriwse -- to keep his Android phone switched on during the journey then again the IRCTC would be in a position to locate the position of the train on Google Maps.

Of course this assumes that there will be at least one passenger on the train who has (a) purchased a ticket through IRCTC and (b) has a smartphone. Given that smartphones are proliferating throughout the country and that the IRCTC website is the most popular eCommerce site in the country it will not be too difficult to meet these two conditions. Having more than one known passenger equipped with an Android -- or any other smartphone with GPS features -- will allow aggregation of data and hence greater reliability. In fact, this means that we are tracking train positions using data that is crowd-sourced from train passengers.

Tracking trains using the GPS features of the Android device may not be precise enough to actuate train signals. The gap between two parallel tracks is possibly lower than the resolution used of the GPS device. However Google Maps based portal that aggregates and broadcasts passenger data will be useful not just for passengers but also for the railways themselves -- and the best part is that other than building and managing the portal there is no cost to the railways.

Google Russia has collaborated with the Russian Railways to create an unique application that allows anyone to take a virtual ride from Moscow to Vladivostok on the Trans Siberian Railway. I am sure that if the Indian Railways were to embark on this project, Google India would be glad to help in this regard.

Many years ago, before the era of the ubiquitous cellphone, I had come across an FMCG company that tried to track the position of its trucks by giving food coupons to the drivers that could be redeemed at selected dhabas across the country. The idea was that as a driver “checks-in” into a dhaba and uses the free coupon to pay for food, the dhaba owner would not only get the money from the company but in return would report the position of the consignment -- as evident from a code number on the coupon that was being redeemed -- back to the company.

That elegant idea was perhaps ahead of its time. But today, with  Android phones and Google Maps, this idea can be easily implemented not only in the Railways but for any other transporter as well.
an earlier version of this article appeared in


Kartik said...

Excellent idea sir...I can share my experience in using the Google Latitude app on my Galaxy tablet.

Some minor constraints (rather inconveniences) that I recently faced while traveling from Kolkata to Hyderabad via Falaknuma Express:

1) Internet connectivity - I use a BSNL 3G sim in my tablet and while traveling away from the major cities lost connectivity so frequently that irritated me while using the Latitude app and internet in general.

2) When any mobile device is trying to access the not so strong network, it uses a lot more battery power than normal. Hence, I was lost my battery charge very quickly. Not all trains have sufficient charging points in the 2AC and 3AC coaches (Exceptions - Rajdhanis and some others)

Lets hope that the railways and the telecom service providers can improve upon the above mentioned infrastructure so that such wonderful ideas as yours can be implemented!

Somnath Mitra said...

Sir, great idea.