Skip to content

Instantly share code, notes, and snippets.

@WanderingHogan
Last active March 23, 2016 05:42
Show Gist options
  • Select an option

  • Save WanderingHogan/a8c3d70c63048660a925 to your computer and use it in GitHub Desktop.

Select an option

Save WanderingHogan/a8c3d70c63048660a925 to your computer and use it in GitHub Desktop.
gtfs creates statements
//import the gtfs data as CSV, comma delimited, headers included
CREATE TABLE stops (
stop_lat numeric,
zone_id varchar(20),
stop_lon numeric,
stop_url varchar(250),
stop_id numeric,
stop_desc varchar(250),
stop_name varchar(250),
location_type numeric,
the_geom geometry
);
CREATE TABLE trips (
block_id varchar(25),
route_id varchar(25),
direction_id numeric,
trip_headsign varchar(25),
shape_id numeric,
service_id varchar(40),
trip_id numeric
);
CREATE TABLE stop_times (
trip_id,
arrival_time,
departure_time,
stop_id,
stop_sequence,
stop_headsign,
pickup_type,
drop_off_type,
shape_dist_traveled,
timepoint
);
CREATE TABLE shapes (
shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled
);
CREATE TABLE routes (route_long_name,route_type,route_text_color,agency_id,route_id,route_color,route_desc,route_url,route_short_name);
CREATE TABLE feed_info (feed_publisher_name,feed_publisher_url,feed_lang,feed_start_date,feed_end_date,feed_version);
CREATE TABLE calendar_dates (service_id,date,exception_type);
CREATE TABLE calendar (service_id,start_date,end_date,monday,tuesday,wednesday,thursday,friday,saturday,sunday);
CREATE TABLE agencyy (agency_url,agency_name,agency_timezone,agency_id,agency_lang);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment