Skip to content

Instantly share code, notes, and snippets.

View carlospuk's full-sized avatar

Carl Partridge carlospuk

View GitHub Profile
@dsamojlenko
dsamojlenko / getNextTripsForStop.sql
Last active February 13, 2017 10:29
MySQL Stored Procedure to get upcoming bus times for a stop from GTFS data. This query includes buses that started running before midnight on the night before but continue through the current day. It also includes service additions and removals from calendar_dates. WARNING: without the proper indices, this query can be VERY slow. See my other Gi…
DELIMITER $$
DROP PROCEDURE IF EXISTS `ocdata`.`getNextTripsForStop`$$
CREATE PROCEDURE `ocdata`.`getNextTripsForStop` (
IN SelectedStop VARCHAR(6),
IN SearchDateTime DATETIME
)
BEGIN