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

Optional transit line penalties when no explicit line was given #19

Closed aheld84 closed 4 years ago

aheld84 commented 4 years ago

This relates to #18

Currently, if no transit line is given, all edges get penalty factor 0 regardless of whether there are transit lines following the edge or not. The change introduced in this commit will give penalty factor 0 if there is at least one transit line following the edge and penalty factor 1 if there are no transit lines at all following the edge. Behavior in the case when a transit line is given is untouched.

This should improve routing results by preferring edges with associated transit lines. This used to be the behavior before some refactoring. Maybe it was broken unintentionally.

aheld84 commented 4 years ago

Converted to draft since the solution suggested so far is not correct (see #18 )

aheld84 commented 4 years ago

I have changed the PR such that it does not change the default behavior any more.

An additional penalty for edges without any transit lines can be added by setting routing_no_lines_punish_fac to a positive value in the config. The punishment is only active when no explicit transit line name/from/to was requested in the routing attrs.

patrickbr commented 4 years ago

Great, thank you very much. Merged.