Skip to content

move bike route handling into custom models - #3226

Merged
karussell merged 4 commits into
masterfrom
cleanup_priority
Nov 14, 2025
Merged

karussell merged 4 commits into
masterfrom
cleanup_priority

Conversation

@karussell

@karussell karussell commented Nov 7, 2025 •

Copy link
Copy Markdown
Member

This moves the bike route handling (bike_network) out of the priority parser into the custom models, like we already do for hike_network and hike.json.

The advantage is a bit less code and also that we can apply higher values necessary for a situation like this route. In general this area is a nice real world case to tune "bike route" and "bike designated" relevance. E.g. this route uses the local bike network and this route the international and this route the "middle" way that has a good & separated & designated highway=path.

But not too heavy boost is required to avoid local routes with rather big incline.

@karussell karussell added the osm label Nov 7, 2025
@karussell karussell changed the title Cleanup priority parsers Cleanup bike priority parsers Nov 7, 2025

@ratrun ratrun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the questions in the file bike.json I don't have other comments

// to use this custom model you need to set the following option in the config.yml
// graph.elevation.provider: srtm # enables elevation
// graph.encoded_values: bike_priority, bike_access, roundabout, bike_average_speed, bike_road_access, foot_road_access, average_slope, mtb_rating, hike_rating, country, road_class
// graph.encoded_values: bike_priority, bike_access, bike_network, roundabout, bike_average_speed, bike_road_access, foot_road_access, average_slope, mtb_rating, hike_rating, country, road_class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this branch with my existing config and am a little bit confused now: adding of the bike_network to graph.encoded_values in config.yml is actually not needed. You also didn't add it to config-example.yml. Can you please explain why this is not needed? As it is not needed, would it be possible to just don't add bike_network here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange, when you remove it you should get "Encoded values missing: bike_network." as we do not add it by default here. Are you sure you didn't add it via java by default in your code and you are using the latest bike.json from this branch?

For config-example.yml, we have enabled only car by default, and therefore I did not add it there and only in the documentation of bike.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you didn't add it via java by default in your code and you are using the latest bike.json from this branch?

I seem to have tested with a wrong branch. Now I need to add bike_network to the graph.encoded_values. 😌

For config-example.yml, we have enabled only car by default, and therefore I did not add it there and only in the documentation of bike.json

I would prefer to list all available encoded value strings in the example file as it is nowhere documented that the example strings only contain those which are applicable for car. It actually says

# Possible values: road_class,road_class_link,road_environment,max_speed,road_access

...

@karussell karussell Nov 13, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds indeed simpler. Should we include all necessary encoded values for car.json, bike.json and foot.json in config-example.yml by default? (I would do this in a separate code change)

@ratrun ratrun Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include all necessary encoded values for car.json, bike.json and foot.json in config-example.yml by default?

Yes please!

Reading your answer carefully I get the impression that you intend to remove the documentation in the various custom profile files. I see the need for both as there are two use-cases:

  1. If one just wants to use one of the example default profiles: Then I need to look up the needed encoded values in the respective json file and make sure to configure these in my config.yml
  2. If one wants to learn what is possible with encoded values I need a list of the available ones. The best location for this list is in the config-example.yml

I would do this in a separate code change

Definitely! Maybe you can somehow structure the available encoded values somehow as the list is becoming longer and longer and there is currently no obvious order. One order method would be alphabetically, but maybe you have better ideas.

@karussell karussell changed the title Cleanup bike priority parsers bike priority parsers: move bike route handling into custom models Nov 13, 2025
@karussell karussell changed the title bike priority parsers: move bike route handling into custom models move bike route handling into custom models Nov 13, 2025
@karussell karussell added this to the 12.0 milestone Nov 14, 2025
@karussell
karussell merged commit 3c9efb0 into master Nov 14, 2025
@karussell
karussell deleted the cleanup_priority branch November 14, 2025 10:11
karussell added a commit that referenced this pull request Jan 28, 2026

This branch was previously deployed

1 inactive deployment
benchmarks — 58729bdc Deployed Nov 13, 2025 by karussell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants