pub struct RawMap {
pub name: MapName,
pub roads: BTreeMap<OriginalRoad, RawRoad>,
pub intersections: BTreeMap<NodeID, RawIntersection>,
pub buildings: BTreeMap<OsmID, RawBuilding>,
pub areas: Vec<RawArea>,
pub parking_lots: Vec<RawParkingLot>,
pub parking_aisles: Vec<(WayID, Vec<Pt2D>)>,
pub transit_routes: Vec<RawTransitRoute>,
pub transit_stops: BTreeMap<String, RawTransitStop>,
pub boundary_polygon: Polygon,
pub gps_bounds: GPSBounds,
pub config: MapConfig,
}
Fields
name: MapName
roads: BTreeMap<OriginalRoad, RawRoad>
intersections: BTreeMap<NodeID, RawIntersection>
buildings: BTreeMap<OsmID, RawBuilding>
areas: Vec<RawArea>
parking_lots: Vec<RawParkingLot>
parking_aisles: Vec<(WayID, Vec<Pt2D>)>
transit_routes: Vec<RawTransitRoute>
transit_stops: BTreeMap<String, RawTransitStop>
boundary_polygon: Polygon
gps_bounds: GPSBounds
config: MapConfig
Implementations
sourceimpl RawMap
impl RawMap
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 RawMap
impl RawMap
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 RawMap
impl RawMap
sourcepub fn run_all_simplifications(
&mut self,
consolidate_all_intersections: bool,
timer: &mut Timer<'_>
)
pub fn run_all_simplifications(
&mut self,
consolidate_all_intersections: bool,
timer: &mut Timer<'_>
)
Run a sequence of transformations to the RawMap before converting it to a full Map.
We don’t want to run these during the OSM->RawMap import stage, because we want to use the map_editor tool to debug the RawMap.
sourceimpl RawMap
impl RawMap
pub fn blank(name: MapName) -> RawMap
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
pub fn new_osm_way_id(&self, start: i64) -> WayID
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: OriginalRoad) -> Result<PolyLine>
pub fn trimmed_road_geometry(&self, road: OriginalRoad) -> Result<PolyLine>
Generate the trimmed PolyLine
for a single RawRoad by calculating both intersections
sourcepub fn untrimmed_road_geometry(
&self,
id: OriginalRoad
) -> Result<(PolyLine, Distance)>
pub fn untrimmed_road_geometry(
&self,
id: OriginalRoad
) -> Result<(PolyLine, Distance)>
Returns the corrected (but untrimmed) center and total width for a road
pub fn save(&self)
pub fn get_city_name(&self) -> &CityName
sourceimpl RawMap
impl RawMap
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<'de> Deserialize<'de> for RawMap
impl<'de> Deserialize<'de> for RawMap
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
Auto Trait Implementations
impl RefUnwindSafe for RawMap
impl Send for RawMap
impl Sync for RawMap
impl Unpin for RawMap
impl UnwindSafe for RawMap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self