2

I'm trying to build a data store for the GFTS static data, but can't get my head around the relationships between Route, Stop, Stop_Times and Trips.

e.g
Route 2E runs between airport and city centre. It has a fixed number of stops on this route. An instance of the 2E is a trip which leaves the airport at a certain time (9:30) to travel to the city. Its Stop times are the times that this trip specifically will be at designated stops.

However, this implies a link between Route and Stops. Route 2E has 12 stops between Airport and city. This never changes regardless of whether you catch the 9:30 trip or 11:30 trip.

So Stop Times are linked to Trip. But stops should linked to Routes. But every data model I have seen does not show the route stop relationship.

What am I missing ?

0

The same Routes can have different stops, depending on the trip. For example, the trip A goes from airport to city, and trip B goes from airport, to shopping center, then to city. The route's trips have most of the same stops, but some of the trips may have more or less than other ones. It makes more sense to link stop to trip because that is the determination whether a bus stops there or not.

the stops may have all the trips of a route stop there such as the airport, but a stop may have a few trips of a route stop there such as the shopping center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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