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 osm2lanes, guarded by experiment flag #85

Merged
merged 5 commits into from
Sep 5, 2022
Merged

Conversation

dabreegster
Copy link
Contributor

For a-b-street/osm2lanes#248

screencast.mp4

The web app now has a setting to opt into osm2lanes, and the unit tests here can now also check osm2lanes + translation. This sets us up for iterating rapidly on osm2lanes and its integration here.

CC @droogmic and @BudgieInWA. Feel free to review async, I'll likely merge in the morning, but address feedback whenever is good

@@ -0,0 +1,355 @@
use anyhow::Result;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is adapted from a-b-street/abstreet#890. I wrote it in April and have mostly lost context on some of the subtler choices. There's lot in here that's weird/wrong or is stuff that we should fix in osm2lanes proper. But it's a start!


use crate::{get_lane_specs_ltr, Direction, DrivingSide, MapConfig};

// osm2lanes has a more extensive unit test suite, so why does this one exist? This also checks the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to keep these unit tests long term. They serve a different purpose than the more detailed ones in osm2lanes

@@ -5,86 +5,36 @@
"coordinates": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff here is due to updating geom.
before:
Screenshot from 2022-09-04 20-00-24
That road polygon is expressed as a multipolygon with two triangles, which is quite silly.
after:
Screenshot from 2022-09-04 20-00-49
The fix comes from https://github.com/a-b-street/abstreet/issues/951, which is an epic saga to make geom::Polygon always represent a "good" polygon composed of an exterior ring and optional interior rings.

@dabreegster dabreegster merged commit 049b76a into main Sep 5, 2022
@dabreegster dabreegster deleted the lanes_experiment branch September 5, 2022 16:40
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.

None yet

1 participant