6

I am brand new to the General Transit Feed Specification (GTFS) stack and subway calculations and I'm working on a project where I need to tell a user what the best route / line to take based on their current location and the destination latitude and longitude.

I've done some googling and see some good ways to find the closest subway based on current location, but I'm at a loss as to what to do to get the path to the destination if let's say they have to take multiple lines to get to a destination.

Can some one give me some guidance and possible tutorials?

0

4 Answers 4

6

ESRI have a new tool that allow to add GTFS to a Network Dataset, display GTFS Route Shapes, edit GTFS Stop Locations, calculates transit/walking service areas for a specific time of day and day of the week, and more effective gadegets. There is also a blog avout this tool with samples to each procedure a lot of more links

5

You might want to look at OpenTripPlanner. There's an instance set up here that includes the MTA GTFS feeds. It was built with the transit index included, which can be queried via its API to find the nearest stops. The API can also be queried to plan trips.

An example query, to find stops near a point: http://opentrips.codeforphilly.org/opentripplanner-api-webapp/ws/transit/stopsNearPoint/?lat=40.749526&lon=-73.988231

There's a public AMI of the setup, if you're interested. The AMI is: ami-d9517ab0 "OpenTripPlanner Philly NJ NYC DE"

This link will go to launch an instance of it.

Notes in a Google doc, here: http://bit.ly/19aMdw1

0
2

Transitland maintains a feed registry for gtfs data, as well as datasets for each submitting transit agency/authority.
To get transit route information, simply search for the desired route's provider.
I'm in DC, so I searched for WMATA, which took me to WMATA's transit.land profile.
Each transit agency's profile has multiple datasets (Operator Service Area, Routes, Stops, and Scheduling) for consumption/use, each of which offer both JSON/GeoJSON downloads, as well as importing into Mapzen Mobility Explorer and geojson.io.

Other GTFS Routing Tools:
OSRM (Open Source Routing Machine) is a modern C++ routing engine for shortest paths in road networks.
routing.js is a JavaScript library providing GTFS in the browser.

-3

Just some general thoughts:

You can load the vectors for streets and roads into PostgreSQL/PostGIS from OSM, Tiger, or whatever source you have (note that depending on the source there might be some topology issues to work out, a road could be broken into multiple line segments that don't technically connect in the data set, causing your map to send people around the long way).

Then use this: http://pgrouting.org/

Which is a PostgreSQL/PostGIS extension to locate the shortest path. It's already being used in NYC actually: http://www.ridethecity.com/

So that's where I would start. And the best part is that it's all open source, so you can experiment for free and scale up as you need to.

1
  • 2
    I don't see how this uses the GTFS data. Feb 5, 2014 at 11:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.