def getNextStation(station, speed, idx): # if train is stopped do not show next and previous station if float(speed.replace(",", ".")) > 0 and st.has_key(station): # should exist in map to show prev/next return getStation(st[station][idx]) return ""
def distance_from_station(lat1, long1, stationId): if not st.has_key(stationId): return -1 return round(distance_on_unit_sphere(lat1, long1, st_coords[stationId][0], st_coords[stationId][1]), 2)