function makeHeaders() { global $file_routes, $file_trips, $file_stop_times; // routes.txt $header = "route_id,agency_id,route_short_name,route_long_name,route_type"; appendCSV($file_routes, $header); // trips.txt $header = "route_id,service_id,trip_id"; appendCSV($file_trips, $header); // stop_times.txt $header = "trip_id,arrival_time,departure_time,stop_id,stop_sequence"; appendCSV($file_stop_times, $header); }
function writeDRS($DRS) { global $drsFilename; // Add header $csv = 'start_stop_id,end_stop_id,minimum_time_seconds'; appendCSV($drsFilename, $csv); foreach ($DRS as $start_stop_id => $neighbours) { foreach ($neighbours as $neighbour_stop_id => $minimum_time) { $csv = $start_stop_id . ',' . $neighbour_stop_id . ',' . $minimum_time; appendCSV($drsFilename, $csv); } } }
function addRouteInfo($service_id, $date, $route_short_name) { global $file_routes_info_tmp; $csv = ""; $csv .= $route_short_name . ","; $csv .= $service_id . ","; $csv .= $date; appendCSV($file_routes_info_tmp, $csv); }
function addStop($stop_id, $stop_name, $stop_lat, $stop_lon, $platform_code, $parent_station, $location_type) { global $dist; $csv = ""; $csv .= $stop_id . ","; $csv .= $stop_name . ","; $csv .= $stop_lat . ","; $csv .= $stop_lon . ","; $csv .= $platform_code . ","; $csv .= $parent_station . ","; $csv .= $location_type; appendCSV($dist, $csv); }