Skip to content

Commit

Permalink
Get rid of the old sausage link transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Apr 4, 2024
1 parent 3912a24 commit cafe47a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 207 deletions.
4 changes: 0 additions & 4 deletions docs/how_it_works.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ A "degenerate" intersection has only two roads connected. Sometimes that interse

There are special cases documented in the code.

### CollapseSausageLinks

A "simple sausage link" is a dual carriageway that split very briefly and then re-joins, with no intermediate roads. These are collapsed into one road between the intersections, with a barrier lane inserted in the middle. The code is well-documented and better reference.

### MergeDualCarriageways (experimental)

TODO. Explain branches and bridges.
29 changes: 0 additions & 29 deletions osm2streets/src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,33 @@ mod collapse_short_road;
mod dual_carriageways;
mod parallel_sidepaths;
mod remove_disconnected;
mod sausage_links;

/// An in-place transformation of a `StreetNetwork`.
pub enum Transformation {
ZipSidepaths,
RemoveDisconnectedRoads,
CollapseShortRoads,
CollapseDegenerateIntersections,
CollapseSausageLinks,
MergeDualCarriageways,
}

impl Transformation {
/// Useful for test cases and small clipped areas. Doesn't remove disconnected roads.
pub fn standard_for_clipped_areas() -> Vec<Self> {
vec![
Transformation::CollapseSausageLinks,
Transformation::CollapseShortRoads,
Transformation::CollapseDegenerateIntersections,
// The above may discover more roads to collapse
Transformation::CollapseShortRoads,
]
}

/// A full suite of transformations for A/B Street.
///
/// A/B Street doesn't handle separately mapped footways and sidewalks yet, so things to deal
/// with that are here.
pub fn abstreet() -> Vec<Self> {
let mut list = Self::standard_for_clipped_areas();

// Not working yet
if false {
let mut prepend = vec![
Transformation::ZipSidepaths,
Transformation::RemoveDisconnectedRoads,
];
prepend.extend(list);
list = prepend;
} else {
list.insert(0, Transformation::RemoveDisconnectedRoads);
}

list
}

fn name(&self) -> &'static str {
match self {
Transformation::ZipSidepaths => "zip parallel sidepaths",
Transformation::RemoveDisconnectedRoads => "remove disconnected roads",
Transformation::CollapseShortRoads => "collapse short roads",
Transformation::CollapseDegenerateIntersections => "collapse degenerate intersections",
Transformation::CollapseSausageLinks => "collapse sausage links",
Transformation::MergeDualCarriageways => "merge dual carriageways",
}
}
Expand All @@ -79,9 +53,6 @@ impl Transformation {
Transformation::CollapseDegenerateIntersections => {
collapse_intersections::collapse(streets);
}
Transformation::CollapseSausageLinks => {
sausage_links::collapse_sausage_links(streets);
}
Transformation::MergeDualCarriageways => {
dual_carriageways::merge(streets);
}
Expand Down
174 changes: 0 additions & 174 deletions osm2streets/src/transform/sausage_links.rs

This file was deleted.

0 comments on commit cafe47a

Please sign in to comment.