Skip to content

Encode values larger than maxStorableValue as infinity - #2990

Closed
otbutz wants to merge 2 commits into
graphhopper:masterfrom
otbutz:overflow_infinity
Closed

otbutz wants to merge 2 commits into
graphhopper:masterfrom
otbutz:overflow_infinity

Conversation

@otbutz

@otbutz otbutz commented Apr 25, 2024 •

Copy link
Copy Markdown
Contributor
  • TODO: is this problematic for turn costs?

@karussell

Copy link
Copy Markdown
Member

The current approach is more conservative. What would be the advantage of this proposal?

@otbutz

otbutz commented Apr 29, 2024

Copy link
Copy Markdown
Contributor Author

It's only conservative as long as the maximum value we allow to be encoded exceeds what's relevant for routing decisions. #2987 is an example where this strategy introduces artificial weight limits that are far lower than what is actually tagged in OSM, while the encoded value is still in the range of values relevant to truck routing. Searching for a route with a 26t truck in my case.

Ideally, the EV should be able to cover all "sane" values (see #2989), so that we can ignore values that are either tagging errors like kilograms instead of tonnes, or are far too high for our intended use case.

For example, this way has a maximum weight limit of 120t. In practice, this is so high that it's irrelevant for any normal vehicle. But by limiting it to the maximum storage value of the EV, we create an artificial limit within the range of values relevant to large trucks.

@otbutz otbutz closed this Dec 17, 2025
@otbutz
otbutz deleted the overflow_infinity branch December 17, 2025 11:13
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.

2 participants