a method and system for automatically activating a train warning device that uses a positioning system such as a global positioning system receiver or an inertial navigation system to determine the train &# 39 ; s position . the system further includes a database containing locations of grade crossings and other locations at which a train is required to give a warning signal and what regulations govern activation of the warning device at such locations .