Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@enishettyrahul
Copy link

@enishettyrahul enishettyrahul commented Oct 14, 2025

Add vignette as edge attribute.

#fixes #5496

What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
This to differentiate between toll and vignette costing.

Tasklist

  • Add tests
  • Add #fixes with the issue number that this PR addresses
  • Update the docs with any new request parameters or changes to behavior described
  • Update the changelog
  • If you made changes to the lua files, update the taginfo too
  • If you made changes to a translation file, update transifex too

Rahul Krishna Enishetty [email protected], Mercedes-Benz Tech Innovation GmbH
Provider Information

Licensed under MIT

Signed-off-by: Rahul Krishna Enishetty <[email protected]>
Signed-off-by: Rahul Krishna Enishetty <[email protected]>
Signed-off-by: Rahul Krishna Enishetty <[email protected]>
@enishettyrahul enishettyrahul changed the title Add vignette as attribute own fork Add vignette as attribute Oct 15, 2025
Copy link
Member

@nilsnolde nilsnolde left a comment

Choose a reason for hiding this comment

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

we'd like to keep the extra bit out of directededge.h and rather put it in access restrictions.

uint64_t lit_ : 1; // Is the edge lit?
uint64_t dest_only_hgv_ : 1; // destonly for HGV specifically
uint64_t spare4_ : 3;
uint64_t vignette_ : 1; // Edge is part of a road requiring a vignette
Copy link
Member

Choose a reason for hiding this comment

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

we discussed this briefly internally: we'd be happier to not "waste" bits here for smth that's not in OSM. can you put this into baldr/accessrestrictions.h/cc?

Copy link
Author

Choose a reason for hiding this comment

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

Ok I will make the necessary changes as suggested.

Copy link
Member

Choose a reason for hiding this comment

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

Be aware that using access restrictions for determining edge cost is not currently implemented. I'm sure it's possible, but it would require a bit of a refactor to avoid evaluating the restrictions twice.

Copy link
Contributor

@johannes-no johannes-no Oct 21, 2025

Choose a reason for hiding this comment

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

Moving this to the access_restrictions got me thinking about our initial problem where we want to avoid vignettes on a country level. Maybe we can do something like we have with the hight restrictions where the access restriction vignette has a value of the country it is in:
image
(Doesnt need to be a string maybe there is a int to country code mapping somewhere)

That way we can pass a list of countrys we want to avoid vignettes in and if the input is for example "all" we avoid it everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

That sounds reasonable. We could store the index into the tile's admin info, which fits into 12 bits. Then we'd even have 52 bits left for more information in the future (not sure what that would be, but maybe there are countries with more than one vignette type, e.g. if highways are operated by different private companies).

@johannes-no
Copy link
Contributor

johannes-no commented Nov 14, 2025

Hallo @nilsnolde and @chrstnbwnkl ,

@enishettyrahul has made the necessary changes to enable the use of vignette in accessrestrictions.cc.
Here is the feature branch.

We have currently tested the CH exclusions in a map, and the Gurka test also works fine.
However, the exclusion of multiple vignettes, such as DE and CH at the same time or the option to exclude "all" does not work correctly.

We added some gurka tests for this, could you please help us to understand the issue in the code?
It seems like it's a soft avoid rather than a hard avoid, since we would expect a “no route found” error, but a route is still found.
Thank you very much in advance.

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

Successfully merging this pull request may close these issues.

Differentiate between "toll" and "vignette" attributes

4 participants