Skip to content
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

Use lane width tags from OSM #222

Closed
dabreegster opened this issue Aug 5, 2023 · 3 comments
Closed

Use lane width tags from OSM #222

dabreegster opened this issue Aug 5, 2023 · 3 comments

Comments

@dabreegster
Copy link
Contributor

sidewalk:{left,right}:width as one example, probably others. Add tests for these.

@dabreegster
Copy link
Contributor Author

More context here: the code in https://github.com/a-b-street/osm2streets/tree/main/osm2lanes/src transforms OSM way tags and describes the lanes along a road from left-to-right. Right now it uses hardcoded lane width values from

pub fn typical_lane_widths(lt: LaneType, highway_type: &str) -> Vec<(Distance, &'static str)> {
. Sometimes lane widths are tagged in OSM, so we should use them when they are. There's a few different width tags that we could use; one simple one is sidewalk:left:width (https://wiki.openstreetmap.org/wiki/Sidewalks#Sidewalk_as_refinement_to_a_highway).

@iakev
Copy link

iakev commented Oct 4, 2023

Hi, @dabreegster I would like to take up this issue. As previously highlighted, I would like to focus on the Rust part, however if you could share some links that I can use to get up to speed on OSM domain knowledge and guidance I would highly appreciate it.

@dabreegster
Copy link
Contributor Author

Hi! For some OSM tags related to width, see https://wiki.openstreetmap.org/wiki/Key:width#Width_of_streets. I would start with the cycleway, sidewalk, and parking lane cases (for when those are part of the main road, and not separate objects). You can use Overpass Turbo and TagInfo to find real-world examples in OSM, like https://taginfo.openstreetmap.org/keys/cycleway:left:width#overview and https://overpass-turbo.eu/s/1Bqk (click Wizard to edit the query). Those can be used to start new unit tests in https://github.com/a-b-street/osm2streets/blob/main/osm2lanes/src/tests.rs. Those tests currently ignore width in the output; I would vote for starting new tests similar to the old, that specifically check for width in some of the output lanes (but not all -- we probably won't know for most of them)

The logic changes would happen in https://github.com/a-b-street/osm2streets/blob/main/osm2lanes/src/algorithm.rs. There's an apply_width function that happens after the main pass. That might be a good place to apply this logic -- you'll already have the lanes left-to-right, so if you see something like a cycleway on the right, you could search in one direction for it. Or maybe it's easier to parse these lane overrides when that lane is first found -- not sure.

Let me know if you get stuck with anything, whether it's Rust, OSM, or otherwise. Thanks for helping out on this!

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

No branches or pull requests

2 participants