Struct street_network::StreetNetwork
source · [−]pub struct StreetNetwork {
pub roads: BTreeMap<OriginalRoad, RawRoad>,
pub intersections: BTreeMap<NodeID, RawIntersection>,
pub boundary_polygon: Polygon,
pub gps_bounds: GPSBounds,
pub config: MapConfig,
}
Fields
roads: BTreeMap<OriginalRoad, RawRoad>
intersections: BTreeMap<NodeID, RawIntersection>
boundary_polygon: Polygon
gps_bounds: GPSBounds
config: MapConfig
Implementations
sourceimpl StreetNetwork
impl StreetNetwork
sourceimpl StreetNetwork
impl StreetNetwork
fn mark_short_roads(&mut self, list: Vec<OriginalRoad>) -> Vec<OriginalRoad>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn find_traffic_signal_clusters(&mut self) -> Vec<OriginalRoad>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn find_traffic_signal_clusters(&mut self) -> Vec<OriginalRoad>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A heuristic to find short roads near traffic signals
sourcepub fn find_dog_legs(&mut self) -> Vec<OriginalRoad>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn find_dog_legs(&mut self) -> Vec<OriginalRoad>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A heuristic to find short roads in places that would otherwise be a normal four-way intersection
|
|
---X~~X----
|
|
The ~~ is the short road we want to detect
sourceimpl StreetNetwork
impl StreetNetwork
sourcepub fn merge_short_road(
&mut self,
short: OriginalRoad
) -> Result<(NodeID, NodeID, Vec<OriginalRoad>, Vec<OriginalRoad>)>
pub fn merge_short_road(
&mut self,
short: OriginalRoad
) -> Result<(NodeID, NodeID, Vec<OriginalRoad>, Vec<OriginalRoad>)>
Returns (the surviving intersection, the deleted intersection, deleted roads, new roads)
sourceimpl StreetNetwork
impl StreetNetwork
sourcepub fn run_all_simplifications(
&mut self,
consolidate_all_intersections: bool,
remove_disconnected: bool,
timer: &mut Timer<'_>
)
pub fn run_all_simplifications(
&mut self,
consolidate_all_intersections: bool,
remove_disconnected: bool,
timer: &mut Timer<'_>
)
Run a sequence of transformations to the StreetNetwork before converting it to a full Map.
We don’t want to run these during the OSM->StreetNetwork import stage, because we want to use the map_editor tool to debug the StreetNetwork.
sourceimpl StreetNetwork
impl StreetNetwork
pub fn blank() -> Self
pub fn roads_per_intersection(&self, i: NodeID) -> Vec<OriginalRoad>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn new_osm_node_id(&self, start: i64) -> NodeID
sourcepub fn preview_intersection(
&self,
id: NodeID
) -> Result<(Polygon, Vec<Polygon>, Vec<(String, Polygon)>)>
pub fn preview_intersection(
&self,
id: NodeID
) -> Result<(Polygon, Vec<Polygon>, Vec<(String, Polygon)>)>
(Intersection polygon, polygons for roads, list of labeled polygons to debug)
sourcepub fn trimmed_road_geometry(&self, road_id: OriginalRoad) -> Result<PolyLine>
pub fn trimmed_road_geometry(&self, road_id: OriginalRoad) -> Result<PolyLine>
Generate the trimmed PolyLine
for a single RawRoad by calculating both intersections
sourceimpl StreetNetwork
impl StreetNetwork
pub fn can_delete_intersection(&self, i: NodeID) -> bool
pub fn delete_intersection(&mut self, id: NodeID)
pub fn move_intersection(
&mut self,
id: NodeID,
point: Pt2D
) -> Option<Vec<OriginalRoad>>
pub fn closest_intersection(&self, pt: Pt2D) -> NodeID
pub fn path_dist_to(&self, from: NodeID, to: NodeID) -> Option<Distance>
Trait Implementations
sourceimpl Debug for StreetNetwork
impl Debug for StreetNetwork
sourceimpl<'de> Deserialize<'de> for StreetNetwork
impl<'de> Deserialize<'de> for StreetNetwork
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for StreetNetwork
impl Serialize for StreetNetwork
Auto Trait Implementations
impl RefUnwindSafe for StreetNetwork
impl Send for StreetNetwork
impl Sync for StreetNetwork
impl Unpin for StreetNetwork
impl UnwindSafe for StreetNetwork
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more