You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- stop-times.sql-- Don't forget to add headers to the resulting CSV before uploading to CartoDB
COPY (
SELECT-- agency,-- shortname,-- longname,
lon,
lat,
(CASE
-- before midnight
WHEN arrivaltime <86400 THEN ('2015-06-09 '|| TO_CHAR((arrivaltime ||' second')::interval, 'HH24:MI:SS')::text)::timestamp-- after midnight, subtracting 24 hours creates the looping effect
WHEN arrivaltime >=86400 THEN ('2015-06-09 '|| TO_CHAR(((arrivaltime -86400) ||' second')::interval, 'HH24:MI:SS')::text)::timestamp
END) AS arrivaltime
FROM gtfs_stop_times
INNER JOIN gtfs_stops
ONgtfs_stops.id=gtfs_stop_times.stop_idINNER JOIN gtfs_trips
ONgtfs_trips.id=gtfs_stop_times.trip_idINNER JOIN gtfs_routes
ONgtfs_routes.id=gtfs_trips.route_idWHERE serviceid_id ='1'-- find the weekday service_id
) TO '/Users/drw/Desktop/sfmta-weeday-service-stop-times.csv' WITH CSV;
3. Upload to CartoDB
Pay CartoDB money if your CSV is larger than 50mb
Create a new dataset with the CSV
Select the Torque map setting from the Wizard menu in the sidebar of map view.
Find more GTFS feeds: http://transitfeeds.com/.