motis-project / motis

Intermodal Mobility Information System
https://motis-project.de
MIT License
198 stars 47 forks source link

Default time for transfers (walk) #116

Closed StephanAd closed 3 years ago

StephanAd commented 3 years ago

I have noticed that if the coordinates "from" and "to" of a leg are identical, the duration of this leg is always 4 minutes.

For example: a leg (walk) from Pfäffikon SZ (47.203,8.77813) to Pfäffikon SZ (47.203,8.77813) with a duration of 4 minutes. I observe this for each leg where the coordinates of "from" and "to" are identical. So i guess this happens by default?

Furthermore, all footpaths of a connection are always in steps like 1, 2, 4, 6, 8, ... Minutes. I did not see any connection in my test data that required a walk of 5 or 7 minutes for a transfer, for example. Is this due to MOTIS or did I miss something?

felixguendling commented 3 years ago

If the GTFS dataset provides a transfer time (via transfers.txt), Motis will use this. Otherwise, stations that are in close geographic proximity will be connected through generated transfers with a transfer time of 2 minutes:

https://github.com/motis-project/motis/blob/3dfdbf4ea505025cce5220a32a7f8c04c4d6ef52/base/loader/src/gtfs/gtfs_parser.cc#L496-L499

Note however, that this is the minimum transfer time. If the next vehicle departs a few minutes after the minimum transfer time, you will experience other deltas between arrival at the station with one trip and departure with another.

Furthermore, all footpaths of a connection are always in steps like 1, 2, 4, 6, 8, ... Minutes.

Basically, the footpath length are specified in the transfers.txt. Only if the transfers.txt does not provide any transfer time, Motis will generate a 2 min transfer if two stations are close enough. But ideally, the transfers.txt already contains transfer times for all stations that are located close to each other so this extra step is not necessary.

StephanAd commented 3 years ago

Thanks for the detailed answer, that helped my understanding a lot. I have looked at the files and my results are consistent with them.