ad-freiburg / pfaedle

Precise map-matching for public transit feeds. Generates high-quality GTFS shapes from OSM data.
GNU General Public License v3.0
208 stars 29 forks source link

Transit line penalties when no explicit transit line is given #18

Closed aheld84 closed 4 years ago

aheld84 commented 4 years ago

Currently, the transit line penalty factor is always 0 when no explicit transit line is given in the routing attrs regardless of whether there are transit lines following an edge or not.

This used to be different before this refactoring: https://github.com/ad-freiburg/pfaedle/commit/4733b0c676fb247b6c7973acaac96276b2fd2769#diff-332edfa701663f40b7846ecfb8f455eeR110-R112

Before, the penalty factor was 0 if there is at least one transit line following the edge and 1 if there are no transit lines at all following the edge.

I am not sure, if this change was on purpose or not. I think the old behavior had better routing results when no explicit transit line was given, since edges without associated transit lines got a higher penalty than edges with associated transit lines.

I have a proposed fix which I will add as a pull request in a moment.

Can you please check whether this is a bug or intended behavior?

patrickbr commented 4 years ago

This was changed on purpose. I think the correct way to address this issue would be to add an additional penalty factor to the configuration which is used if no transit lines are given in the query and no transit lines are following the edge. By default, this penalty should be 0. This way the change won't break the current behavior.

aheld84 commented 4 years ago

Thank you for your input on this subject. I will go for the solution you suggested and update the pull request accordingly.

aheld84 commented 4 years ago

I have updated PR #19 to make the additional penalty optional and configurable

patrickbr commented 4 years ago

Merged, thanks again for your work!