Repository navigation
Conversation
| else | ||
| kv["max_speed"] = normalize_speed(kv["maxspeed"]) | ||
| -- max speeds are allowed to be unlimited | ||
| local speeds_tags = { max_speed="maxspeed", forward_speed="maxspeed:forward", backward_speed="maxspeed:backward" } |
There was a problem hiding this comment.
I think it'd be more consistent to also allow the directional variants to be unlimited.. Shouldn't really happen, but I've seen it in at least synthetic OSM data
| uint64_t max_speed_ : 8; // speed_ can be maxspeed:advisory or maxspeed:practical | ||
| uint64_t spare4_ : 1; |
There was a problem hiding this comment.
oh man... this is really rough. i'm having a hard time making a case for this just because of advisory or practical. i'd almost rather just stop parsing advisory or practical so we can use speed_ instead.
@dnesbitt61 or @gknisely your thoughts?
There was a problem hiding this comment.
Haha no worries, I figured so! An alternative could be to change the SpeedType enum to kTagDefault, kTagPractical, kTagMax, kClassified:
Plus the code to parse them from the PBF.. And reverse however speed was enhanced after parsing. That way we could at least detect if the tagged speed is from a maxspeed tag and not one of the others and not write too low speeds to max_speed_..
Or chop default & practical ;) Or a no-merge.. up to you.
There was a problem hiding this comment.
speed_type in DirectedEdge is only 1 bit so this doesn't seem practical.
There was a problem hiding this comment.
i had this thought too. actually i think we can do it by taking a single free bit, shifting it one and oring it with the existing bit. effectively making this speed type field 2 bits wide. it would almost be backwards compatible in that old data would work with the new code. but new data with old code would mean that anything that were advisory or practical speed types would look like categorized speed types. i feel like this is a livable compromise since since they are sparsely populated in the data.
There was a problem hiding this comment.
i feel like this is a livable compromise
totally agreed!
There was a problem hiding this comment.
Ugh sorry, I'm getting confused here anyways.. With the new approach (2 bit SpeedType) speed is what will hold the maxspeed, not speed_limit (not accessible to DirectedEdge). So shortcuts are fine actually..
Tbh, I don't really understand why different speeds are a reason to not create a shortcut @dnesbitt61 .. Couldn't the top_speed costing work with average speeds on the accumulated shortcut? The same for setting a speed_ on the final shortcut DirectedEdge, no? Probably I'm missing a crucial step here, but I can't see it.. Supporting a legal speed limit for motorized costings would need some logic like that though, but it could be limited to maxspeed tagged ones.
There was a problem hiding this comment.
I take back my comment on truck routing and truck speed - it doesn't look like truck speed is used when doing truck routing which seems wrong.
Wouldn't any costing that uses some penalty or avoidance when speed is above some threshold need to make sure that shortcuts don't filter out such speeds? A connected set of edges that are 45MPH, then 55MPH, then back to 45MPH would need to keep the 55MPH section separate if any costing penalizes edges above 45MPH. Alternatively, any costing which penalizes or avoids edges by speed might need to avoid using shortcut edges.
There was a problem hiding this comment.
it doesn't look like truck speed is used when doing truck routing which seems wrong
actually it's used when GetSpeed() is called in the costing, there's a (fairly new I think) is_truck bool arg.
A connected set of edges that are 45MPH, then 55MPH, then back to 45MPH would need to keep the 55MPH section separate if any costing penalizes edges above 45MPH
yeah, of course..
There was a problem hiding this comment.
been doing only bicycle routing recently and haven't followed recent updates to speeds and their use (or shortcuts for that matter). Sorry for wading into this discussion without full knowledge!
There was a problem hiding this comment.
All good, you cleared up some misconceptions on my side:)
| min_speed_limit = | ||
| directededge->max_speed() < min_speed_limit ? directededge->max_speed() : min_speed_limit; |
There was a problem hiding this comment.
this is bs anyways.. need to think about that again..
|
I have a hard time approving adding yet another speed to DirectedEdge (speed, free-flow, constrained-flow, truck already exist) but I will defer to others. I've already used those bits for Mountain Bike attribution (so perhaps I'm just biased here). When speed_type == SpeedType::kTagged isn't the speed value equal to the speed limit? It looks like there are a couple cases where speed is reduces on rough surfaces, but otherwise speed is usually the speed limit. |
|
Motor scooter costing has similar limitations but it seems that rather than not allowing on roads exceeding some speed limit, the approach was to penalize roads with speeds above the scooter's top speed. This perhaps could be revisited to use similar logic to e-bikes (which perhaps should be its own costing profile rather than adding yet another condition to bicycle costing). |
@dnesbitt61 in the case where practical_speed or default_speed are also set on a OSM way.
actually we added it to all motorized vehicles a few PRs back. As you say, the logic is penalization, but if you're talking about a legal speed limit I think relevant edges should be absolutely avoided. I'm hoping their project continues so we could look at developing a proper e-bike profile.. |
|
never heard back on this from the client, I'll remove it from the queue |
fixes #2840
As described in the issue.. Pretty special use case I'd say, but since I implemented it for a client already, maybe you have some use for it too? The client's use case was e-(cargo-)bikes somewhere in Michigan, which are apparently not allowed on roads which have a max speed higher than ~50 KPH. No idea if that's a common thing anywhere else, but here it goes..
Tasklist