opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.18k stars 1.02k forks source link

Generate documentation for OSM tag mappers #5929

Closed leonardehrenfried closed 2 months ago

leonardehrenfried commented 3 months ago

Summary

This adds a doc generator for the OSM tag mappers. This documentation is useful for non-developers to look up which OSM tags influence the routing in what way.

It looks like this:

image

A few small refactorings are also part of this PR:

Issue

Closes #5556

Documentation

:heavy_check_mark:

cc @tsobuskerudbyen

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.62%. Comparing base (e1c02b2) to head (07bdb99). Report is 137 commits behind head on dev-2.x.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev-2.x #5929 +/- ## ============================================= + Coverage 69.43% 69.62% +0.19% - Complexity 17067 17128 +61 ============================================= Files 1935 1937 +2 Lines 73612 73740 +128 Branches 7540 7547 +7 ============================================= + Hits 51115 51345 +230 + Misses 19873 19757 -116 - Partials 2624 2638 +14 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

leonardehrenfried commented 3 months ago

Sort menu items alphabetically

leonardehrenfried commented 3 months ago

@JohanEntur @tsobuskerudbyen Since you're going to be one of the main readers of this new documentation, can you take a look https://github.com/opentripplanner/OpenTripPlanner/blob/669da728640d42923220743277f7c4b78a3a8ed5/docs/osm/Norway.md and check this is helpful for you?

Once this PR is merged, it will become part of the main OTP documentation and use the regular styling, rather than the Github one.

JohanEntur commented 3 months ago

@Bjoern-Rapp 👀

JohanEntur commented 3 months ago

It's a good overview to bypass reading the code. Still a complex set to grasp, but this is warmly welcomed.

leonardehrenfried commented 3 months ago

@JohanEntur Yes, it will not replace a programmer having to answer complicated questions but it will help casual users to figure out the answer to "Does OTP use tag X?".

tsobuskerudbyen commented 3 months ago

Looks good, but the comment above is in a way good and should be written out in the top. Suggestion: "If a OpenStreetMap (OSM) tag is not part of the documentation under it is not used by OpenTripPlanner (OTP)." And what does an empty cell under the "bike safety" column man? E.g. for the highway=bridleway line. Neutral? Not allowed?

leonardehrenfried commented 3 months ago

And what does an empty cell under the "bike safety" column man? E.g. for the highway=bridleway line. Neutral? Not allowed?

This means that the bike safety is unaffected by this selector. I could have written "1" but that clutters up the table quite a bit.

leonardehrenfried commented 3 months ago

@tsobuskerudbyen I have added a bit more information to the document. Check out the current version here: https://github.com/opentripplanner/OpenTripPlanner/blob/93a132ad9d1ca2a8bddc642b4f917437a4ed73ed/docs/osm/Norway.md

tsobuskerudbyen commented 3 months ago

Look good. Thanks!

leonardehrenfried commented 2 months ago

@JohanEntur @tsobuskerudbyen The deployed version of the Norwegian documentation is here: https://docs.opentripplanner.org/en/dev-2.x/osm/Norway/

From now on it will always be up to date.