Skip to content

Extend conditional tags supported by MaxWeightExceptParser#3151

Open
otbutz wants to merge 6 commits intographhopper:masterfrom
otbutz:maxweightrating_cond
Open

Extend conditional tags supported by MaxWeightExceptParser#3151
otbutz wants to merge 6 commits intographhopper:masterfrom
otbutz:maxweightrating_cond

Conversation

@otbutz
Copy link
Copy Markdown
Contributor

@otbutz otbutz commented Mar 31, 2025

I recently updated the Achenseestraße in OSM, which has a conditional weight restriction with an exemption for destination traffic:

maxweightrating:hgv=7.5
maxweightrating:hgv:conditional=none @ destination

My local instance kept blocking this road even after whitelisting max_weight_except == DESTINATION in my custom model. The problem was quite simple, the parser doesn't handle maxweightrating:hgv:conditional yet.

With these changes it should cover all conditional variants of the tags supported by the OSMMaxWeightParser.

@karussell
Copy link
Copy Markdown
Member

karussell commented Mar 31, 2025

To be honest this encoded value is kind of a nice hack and quite unintuitive to grasp (even for me as the 'inventor' ;) ). But more importantly it is not a generic solution to the problem that we cannot handle arbitrary strings in the algorithm.

I'm currently investigating and developing a prototype where I use the KVStorage in the algorithm directly, which could evaluate such conditionals more precise and still avoid writing Java code. (And with certain optimizations and some kind of internal access encoded values even without a slow down of Dijkstra/A* routing. At least for server-side custom models. But even without this the slow down is currently only between 1.5x to 2x.)

The related problem is to move the private/delivery configuration out of the encoded value definition into the custom model (#3076). Kind of a bigger change.

@otbutz
Copy link
Copy Markdown
Contributor Author

otbutz commented Mar 31, 2025

In addition, conditional tags are quite difficult to understand. In this case, a maxweight tag indirectly changes the access of a road. So +1 from me for lifting this a level higher up into the custom model.

I'd still like this to be merged if only for the selfish purpose of keeping my fork a little closer to upstream :)

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