1 mod city;
2 pub mod connectivity;
3 mod edits;
4 mod make;
5 mod map;
6 mod objects;
7 pub mod osm;
8 mod pathfind;
9 pub mod raw;
10 mod traversable;
11 
12 pub use crate::city::City;
13 pub use crate::edits::{
14     EditCmd, EditEffects, EditIntersection, EditRoad, MapEdits, PermanentMapEdits,
15 };
16 pub use crate::map::MapConfig;
17 pub use crate::objects::area::{Area, AreaID, AreaType};
18 pub use crate::objects::building::{
19     Building, BuildingID, BuildingType, NamePerLanguage, OffstreetParking,
20 };
21 pub use crate::objects::bus_stop::{BusRoute, BusRouteID, BusStop, BusStopID};
22 pub use crate::objects::intersection::{Intersection, IntersectionID, IntersectionType};
23 pub use crate::objects::lane::{
24     Lane, LaneID, LaneType, PARKING_LOT_SPOT_LENGTH, PARKING_SPOT_LENGTH,
25 };
26 pub use crate::objects::parking_lot::{ParkingLot, ParkingLotID};
27 pub use crate::objects::road::{DirectedRoadID, Direction, Road, RoadID};
28 pub use crate::objects::stop_signs::{ControlStopSign, RoadWithStopSign};
29 pub use crate::objects::traffic_signals::{ControlTrafficSignal, PhaseType, Stage};
30 pub use crate::objects::turn::{
31     CompressedMovementID, Movement, MovementID, Turn, TurnID, TurnPriority, TurnType,
32 };
33 pub use crate::objects::zone::{AccessRestrictions, Zone};
34 pub use crate::pathfind::uber_turns::{IntersectionCluster, UberTurn, UberTurnGroup};
35 use crate::pathfind::Pathfinder;
36 pub use crate::pathfind::{Path, PathConstraints, PathRequest, PathStep};
37 pub use crate::traversable::{Position, Traversable};
38 use abstutil::{deserialize_btreemap, serialize_btreemap};
39 use geom::{Bounds, Distance, GPSBounds, Polygon};
40 use serde::{Deserialize, Serialize};
41 use std::collections::BTreeMap;
42 
43 // TODO Minimize uses of these!
44 pub const NORMAL_LANE_THICKNESS: Distance = Distance::const_meters(2.5);
45 pub const SIDEWALK_THICKNESS: Distance = Distance::const_meters(1.5);
46 pub(crate) const SHOULDER_THICKNESS: Distance = Distance::const_meters(0.5);
47 
48 #[derive(Serialize, Deserialize)]
49 pub struct Map {
50     roads: Vec<Road>,
51     lanes: Vec<Lane>,
52     intersections: Vec<Intersection>,
53     #[serde(
54         serialize_with = "serialize_btreemap",
55         deserialize_with = "deserialize_btreemap"
56     )]
57     turns: BTreeMap<TurnID, Turn>,
58     buildings: Vec<Building>,
59     #[serde(
60         serialize_with = "serialize_btreemap",
61         deserialize_with = "deserialize_btreemap"
62     )]
63     bus_stops: BTreeMap<BusStopID, BusStop>,
64     bus_routes: Vec<BusRoute>,
65     areas: Vec<Area>,
66     parking_lots: Vec<ParkingLot>,
67     boundary_polygon: Polygon,
68 
69     // Note that border nodes belong in neither!
70     stop_signs: BTreeMap<IntersectionID, ControlStopSign>,
71     traffic_signals: BTreeMap<IntersectionID, ControlTrafficSignal>,
72 
73     gps_bounds: GPSBounds,
74     bounds: Bounds,
75     config: MapConfig,
76 
77     pathfinder: Pathfinder,
78     pathfinder_dirty: bool,
79     // Not the source of truth, just cached.
80     zones: Vec<Zone>,
81 
82     city_name: String,
83     name: String,
84     #[serde(skip_serializing, skip_deserializing)]
85     edits: MapEdits,
86 }
87