Pt.profile and pt.ignore_transfers

Hello @michaz!
I was wondering what does pt.profile=true actually do? Also why is it not possible to use pt.profile=true and pt.ignore_transfers=false?

When I just set pt.profile=true and make the same request twice (I do not change the parameters at all), the first response contains 1 route and the second response contains 3. Any reason for the difference in responses?


pt.profile=true is a so-called range or profile query, which asks for all the trips which are, at some point in a given time window, optimal. The result of a 24-hour profile query is what you would hang next to your door, and for every point in time, the next trip on that list would be the best trip to take.

“Optimal” implies “single criterion”, which is “earliest arrival time” here. This can (easily) be extended to multiple criteria (like number of transfers), but we currently don’t do that, as it doesn’t perform well and also requires more explanation. (As it is now, the output is neatly sorted by ascending arrival time, and it’s clear what it means.)

Oh, interesting. What happens the third and fourth time? :slight_smile: The intended behavior is that pt.profile=true keeps searching indefinitely in principle (for later and later trips), but is at some point interrupted either by the requested number of solutions (default 5) or by an arbitrary upper bound on calculation space (number of nodes visited) which I think is currently hardcoded somewhere.