SHAPES.TXT
Driving routes by trip identifier
- Provides list of coordinates to describe path on map of driving route of queried single trip.
- Requires shape id (shape_id) to be appended to URL.
- URL without shape indentifier displays list of available shape ids.
Acquiring trip's path's coordinates
- shape_id is a property of single trip in trips.txt table. There is no such thing as shape of the route or shape of line, since scheduled trips of single line are allowed to have different driving routes.
- Anyway, since in practice routes are same for all trips on single line, best bet to draw a route of line is :
- Acquire route_id from routes.txt by lines well-known friendly name (route_short_name)
- Acquire list of trips belonging to that route_id from trips.txt table.
- Pick a random trip and use it's shape_id for acquiring the coordinates from shapes.txt. (Or better, pick the most common shape_id from that list of trips.)
- Acquire coordinate listing by that shape_id.
- Received coordinates are WGS-84 coordinates, ie. they are directly usable for example for Google maps.
- By Openlayers terminology, the coordinate system is EPGS:4326.
http://data.foli.fi/gtfs/shapes/0_7
[
{
"lat": 60.51109,
"lon": 22.27421,
"traveled": 0
},
{
"lat": 60.51109,
"lon": 22.27422,
"traveled": 0.60009
},
/* ...(snip)... */
{
"lat": 60.43491,
"lon": 22.21961,
"traveled": 13188.18374
}
]