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

Improve block detection #263

Merged
merged 3 commits into from
Apr 5, 2024
Merged

Improve block detection #263

merged 3 commits into from
Apr 5, 2024

Conversation

dabreegster
Copy link
Contributor

Some more steps towards #248. Individual blocks involving dead-end roads now mostly work, thanks to bringing in code from https://github.com/a-b-street/abstreet/blob/main/blockfinding/src/lib.rs. (Why solve problems twice?)

And then improve block classification by looking only at the lane closest to the block, not the whole road. Many cases improve.

I looked at loads of before/afters through this, but didn't take any screenshots this time.

(road.src_i, road.dst_i)
}
};
let mut current_intersection = start_intersection;
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 feel like all of this logic ought to be simpler if we trace tuples (road, left / right, forwards / backwards). I might try that in a future PR.


// TODO Use RoadEdge?
// This skips the "interior" piece of any loop roads
pub fn get_road_sides_sorted(&self, streets: &StreetNetwork) -> Vec<RoadSideID> {
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 would be quite nice to explore in a smaller unit test, because I've found it confusing

@dabreegster dabreegster merged commit 759c515 into main Apr 5, 2024
@dabreegster dabreegster deleted the blocks_v3_just_swap_out_code branch April 5, 2024 15:26
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.

1 participant