-
Notifications
You must be signed in to change notification settings - Fork 700
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
Support "access:conditional"
conditional restrictions like "access:conditional"="no @ (Oct-May)"
#5048
Support "access:conditional"
conditional restrictions like "access:conditional"="no @ (Oct-May)"
#5048
Conversation
"access:conditional"="no @ winter"
and other "access:conditional"
src/mjolnir/timeparsing.cc
Outdated
boost::algorithm::replace_all(condition, "winter", "Dec-Feb"); | ||
boost::algorithm::replace_all(condition, "summer", "Jun-Aug"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and if its the southern hemisphere we need to flip them 😄 i guess we dont have an easy way we could, once we know the latitude, make this choice... we'd have to store some other temp info about how we assumed northern hemisphere and how we need to shift the time by 6 months if it happened to be in the southern hemisphere? sounds like a pita but getting it wrong isnt really an option either right? or am i missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 Now I see why Valhalla didn't support this in the first place.
Let me remove this change and keep only the "access:conditional"
handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its sad but it could be done, just a bit more involved passing state from at least the way/relation tagging until we get to the node tagging (where we finally know the lat lng). totally doable imho but def more involved (have to make storage for it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, now I'm thinkinking that seasons support is quite orthogonal to the tag support.
And for seasons, AFAIK, Valhalla aways processes ways after nodes, so a conditional substitution ("summer"/"winter" -> month range) somewhere in the pbfgraphparser.cc should do the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was pretty sure we did ways, relations, then finally nodes. the reason to do this is because there are lots of ways and relations (with even more nodes) that we dont care about routing on at all and so by first filtering down the ways and relations to what we care about we can skip tons and tons of nodes that we wouldnt need to parse and then just throw away.
but i guess it doesnt matter that i dont understand what you're thinking 😄 if you think you can get the seasons straightened out please by all means do so!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right. Nodes get resolved after ways and relations =\
enum class BuildStage : int8_t {
kInvalid = -1,
kInitialize = 0,
kParseWays = 1,
kParseRelations = 2,
kParseNodes = 3,
kConstructEdges = 4,
//...
};
Well, then I have no idea how to do it without introducing additional complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this piece of code in b802645 and updated PR name & description to focus solery on "access:conditional"
like "access:conditional"="no @ (Oct-May)"
that still cover a lot of cases for winter restrictions, at least in Europe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be handled in the enhance
stage? There, access restriction units are updated based on the admin they're in. You would have access to the node, and there are spare bits on AccessRestriction
, so maybe use one to temporarily flip it to signal that it needs to be checked for the hemisphere it's in?
…ccess:conditional" support" This reverts commit e011077.
"access:conditional"="no @ winter"
and other "access:conditional"
"access:conditional"
conditional restrictions like "access:conditional"="no @ (Oct-May)"
…e not supported by `get_time_range()`
…:conditional"="no @ (Oct-May)"` (valhalla#5048)
Issue
fixes #2050
There are plenty of roads that are closed during some period of time and that are tagged by `"access:conditional". For example, this road in Alps is closed from October to May - https://www.openstreetmap.org/way/1012815911.
See more using use https://overpass-turbo.eu/
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?