Open Robinlovelace opened 8 months ago
Wider question is how best to represent this? I looked to edit it on https://www.openstreetmap.org/edit?way=958819459#map=20/53.80953/-1.52573 but am not sure how to represent light segregation on carriageway (sometimes on pavement) mostly separated by wand orcas and parked cars. The thing that makes it feel unsafe is the speed and volume of the traffic on the parallel road.
https://www.openstreetmap.org/way/958819459
Maybe https://wiki.openstreetmap.org/wiki/Proposal:Separation#Typical_separation_values flex_post
would be appropriate. Note making OSM edits based on Google Streetview isn't OK, see if there's Bing streetside imagery there
The current LTS algorithm doesn't pay attention to the new separation
tag, but it probably should.
The thing that makes it feel unsafe is the speed and volume of the traffic on the parallel road.
If this road had a maxspeed tagged, then maybe our rule could say that light separation + high maxspeed is bad. CC @cmconlan
Also real world speed data can show that this road is dangerous. Not sure but think it's a 40 mph limit which is sketchy.
This is a nice discussion of something that I also noted, and was discussing with @partavogen.
In Lisbon we have this main road (primary), with a cycleway. Even if the road is busy, It is on of the two main cycleways in the side. In the OSM tags, it is coded as
It looks like this:
With this following example in the online platform, using a small area, 3000 random origins, and 1 destination right in this avenue, the results sound odd, because the routes are not being mostly made in this avenue (see the red count values added), but mostly in some far off-road cycleways (in green).
The LTS classifies it as LTS 3 or 4, correctly, according to the highway tag. But I am not sure how is considering the cycleway:left
tag in the costs.
In these 2 examples, the first one is a secondary street with no bike lane, and presents a cost of 12x.
The second one is the main primary street with a bike lane, and presents a cost of 15x.
Why is that, it if correctly identifies that the "Way has a bike lane because cycleway:left=lane" ? Should it decrease the penalty cost to 8x, as set if cycleway?
Thanks for the detailed info about this case!
Why is that, it if correctly identifies that the "Way has a bike lane because cycleway:left=lane" ?
We're using the OSM to LTS definitions from https://maps.bikeottawa.ca/lts/ without many changes yet, but I think we'll need to make some improvements -- both in general, and possibly to handle some localized tagging styles in some places. In this case, this doesn't count as a separate path (LTS 1) because of this code: https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/ee269f4cf018248647c8b10135d184a8a27c8438/lts/src/bike_ottawa.rs#L47
We have a cycleway = lane, not track. So instead, we're in the bike_lane_case: https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/ee269f4cf018248647c8b10135d184a8a27c8438/lts/src/bike_ottawa.rs#L63
I don't know if that small curb means the tagging should change from https://wiki.openstreetmap.org/wiki/Tag:cycleway%253Dlane to https://wiki.openstreetmap.org/wiki/Tag:cycleway%3Dtrack. If the OSM tags look correct but the LTS output looks wrong, we can start by adding a test case to https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/main/lts/src/tests.rs and updating the LTS logic (which is hopefully easy to understand -- https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/main/lts/src/bike_ottawa.rs or the original JS https://raw.githubusercontent.com/BikeOttawa/stressmodel/master/stressmodel.js. Or if you think it'd be easier to write a new function to assign LTS based on OSM tags for the tagging style in Lisbon, we can do that too: https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/main/docs/tutorial_examples.md#advanced-write-your-own-cost-function (except a custom command for LTS, not cost)
Thanks! I am not sure if changing LTS is the way, when defining the cost by highway type... Why not changing the cost function so if it is highway=X (not cycleway) but also cycleway:left/right/true, the cost equals to the cost defined in highway=cycleway Does that change the "atractivity"/"penalty" of a way like this one? That is what I would expect, but not sure how.
Thanks! I am not sure if changing LTS is the way, when defining the cost by highway type... Why not changing the cost function so if it is highway=X (not cycleway) but also cycleway:left/right/true, the cost equals to the cost defined in highway=cycleway Does that change the "atractivity"/"penalty" of a way like this one? That is what I would expect, but not sure how.
What I mean is: I am not super fan of LTS - it doesn't apply well for places where you don't have a consolidated cycling network, or pedestrian trails, or (simply) a lot of LTS1 and LTS2 ways. And then you are left with only LTS 3 and 4. (this is what happened in biclaR) So, using the OSM highway tags and model some different costs would bring more reliable results in this case (+slope), I guess. But does it needs to use LTS levels anyway?
I see your point. LTS is not necessary; it is just useful as an extra variable to visualize by -- to quickly see lots of flow on good vs bad roads. If you want to totally ignore it and just assign a cost based on OSM tags, you can do that. Just follow https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/main/docs/tutorial_examples.md#advanced-write-your-own-cost-function and in your program, totally ignore the lts
input. What's missing right now is an elevation input, but #18 at least has an outline of the steps to get there.
Maybe a question you'd know: once we have gradient on a road, how do we adjust the cost function for cyclists? I've done https://github.com/a-b-street/abstreet/blob/b3982db88c6b342b78a82188cb823a25dbcfbf7e/map_model/src/traversable.rs#L258 in the past, but I never spent much time seeing if the results were reasonable
A good alternative to LTS is CSNA. We have some docs + I think open issues on that somewhere but cannot recall where atm, @cmconlan may have good links + ideas on this. I agree 4 categories of CSNA is too simple. CSNA has 7. CLOS by Brian Deegan and colleagues has even more. So cool that we can define any cost function in any language btw, making this a key bit of infrastructure for strategic active travel network planning (may take a bit of work to refine stuff but the foundation is solid I'm convinced)!
Ok, I'll try to change the OSM cost function with a if-else statement for the cases when a highway includes a cycle lane.
Maybe a question you'd know: once we have gradient on a road, how do we adjust the cost function for cyclists? I've done https://github.com/a-b-street/abstreet/blob/b3982db88c6b342b78a82188cb823a25dbcfbf7e/map_model/src/traversable.rs#L258 in the past, but I never spent much time seeing if the results were reasonable
I have a slope-cost function explored here that can be used :slightly_smiling_face: https://github.com/U-Shift/Declives-RedeViaria/blob/main/SpeedSlopeFactor/SpeedSlopeFactor.md
Ok, I'll try to change the OSM cost function with a if-else statement for the cases when a highway includes a cycle lane.
Back to this, would you have a cost statement example with a condition that I could adapt, @dabreegster ?
You can write custom logic in any way you want, then call it. An example in Python is https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/main/examples/york/cost.py, configured by doing "cost": { "ExternalCommand": "python3 cost.py" }
. I assume you want to write this in R? I can try to get an example started -- the input is a JSON array of dictionaries, like this:
[
{
"osm_tags": {"highway": "foo", "lanes": 123, ...},
"length_meters": 43,
"lts": 2, // this depends on how you've configured it; you can just ignore it and only use LTS to color things, or not at all
"nearby_amenities": 10, // probably not helpful yet, since it's not broken down
"slope": 1.5, // 1.5% slope
},
{
...another like the above
}
]
If there are 50 edges in this array, then you have to print a JSON array with 50 pairs of numbers of the final cost, like [[435.4, 435.4], [2342.0, 1200.0], ...]
as the only output. Each pair is the cost in the forwards and backwards directions. (Might be a cycle lane in only one direction, or slope changes it.) https://github.com/Urban-Analytics-Technology-Platform/od2net/blob/main/docs/tutorial_examples.md#advanced-write-your-own-cost-function documents these inputs
Just documenting findings as I look at this with Joey:
That's from running it in browser for Leeds. Not an issue with this codebase but with the LTS scoring or OSM tags or combination. There is a light seggregated cycleway on and off the road but is defo not suitable for children, this is quite a scary place to be on a bike:
Source: https://www.google.com/maps/@53.8067038,-1.5294913,3a,60y,90t/data=!3m6!1e1!3m4!1sVjDNXOnf-deeLq26tVSLWg!2e0!7i16384!8i8192?entry=ttu