Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace key hardcoded parameters with config files #49

Open
Robinlovelace opened this issue Nov 14, 2023 · 3 comments
Open

Replace key hardcoded parameters with config files #49

Robinlovelace opened this issue Nov 14, 2023 · 3 comments

Comments

@Robinlovelace
Copy link
Contributor

Currently settings such as the tags associated with paths on which cycling is forbidden are hard coded in .rs files:

if tags.is_any("highway", vec!["footway", "path"])
&& tags.is("footway", "sidewalk")
&& !tags.is("bicycle", "yes")
{
msgs.push(format!(
"Cycling not permitted on highway={}, when footway=sidewalk and bicycle=yes is missing",
tags.get("highway").unwrap()
));

Would it be possible to replace such settings with config files in json for easier editing and less Rust code reading? Aligns with the aim set out in #28 to make this more accessible (and in this case configurable) for others.

Use case: places like Norway and I believe Japan where cycling on footpaths is allowed, or for uses where we want to route cycling on a wider part of the network to inform investment decisions.

@dabreegster
Copy link
Collaborator

This was also raised during the SotM workshop! It needs to be configurable per area for sure. It logically belongs as part of the LTS classification; it's just refactored a bit here. Someone can already write a custom function to determine LTS. I don't think changing out just this piece and leaving the rest (the Bike Ottawa logic right now) would work, because that logic won't assign an LTS to this. I also don't want to invent a configuration language to express LTS rules, since people can run any arbitrary command to calculate LTS.

So... not sure yet, will think about this more

@Robinlovelace
Copy link
Contributor Author

I guess an issue is that the rules defining routing are often more complex than a set of nested key-value pairs. You need to be able to compute on the values as shown in https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/bicycle.lua which contains functions such as oneway_handler

@Robinlovelace
Copy link
Contributor Author

Which values are most likely to be needed by users that will affect the overall score, e.g. the 'stress multiplier'? Identifying those and splitting out as a config file could be good for many users while of course more advanced users can change how the values are used. Something I guess Chris Conlan's (cannot find GitHub tag immediately) work will shed light on.

@Robinlovelace Robinlovelace changed the title Replace hardcoded parameters with config files Replace key hardcoded parameters with config files Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants