I've currently got data on the NYC subway stations (including name, position, and how many people entered and existed during a timeframe). Also, I have the data on which stations have which train lines. However, I don't have the order of these stations on the line. Is there anywhere where this data is already formatted in some way that can be easily used programmatically? I could put them in order in some csv file on my own, but I'd rather avoid that if I can. Thank you much!
MTA data in GIS format
But the GTFS “stops.txt” file only includes station names, not a list of routes. The “stop_times.txt” file includes trip IDs that can be joined with the “trips.txt” file to identify routes as well as stops. But this represents more than 500,000 records (one for each trip by each route stopping at each station). If you dissolved those on the stop_id field (using standard grouping or dissolve functions in Excel or Access, for example), you’d only get the first route ID per station, not a comma-separated inline list like I wanted.
Solution
USE SQL’s “COALESCE
” function
http://spatialityblog.com/2010/07/20/more-mta-data-in-gis-format/
reference (lines) http://spatialityblog.com/2010/07/08/mta-gis-data-update/
Data set with the stops: https://wfs.gc.cuny.edu/SRomalewski/MTA_GISdata/June2010_update/nyctsubwaystops_100627_curcleaned.zip
Full Credit to: Steven Romalewski
-
Does this data actually contain the stations in order? It seems to just have which lines stop at each station. But not the order in which these lines stop there. – golmschenk Dec 18 '12 at 3:47
-
-
The order in either direction. I mean I'm looking for a the data to show which stations are 1 stop away from which other stations. – golmschenk Dec 18 '12 at 18:02
-
The
stop_sequence
value tells you the order of stops for each individual train run, so use that in conjunction withstop_id
. – nmpeterson Apr 16 '13 at 19:27
stops.txt
. They match the coordinates of the stops inshapes.txt
, which give the routes in order. Moreover, the order is explicitly in that table in thedist_traveled
field. For a working solution you could apply any software used to make GPS tracks from sequences of lat-lon readings. – whuber Apr 16 '13 at 23:05