<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="`map_model` describes the world where simulations occur. Importing a map from OSM partly happens in `convert_osm` and here."><metaname="keywords"content="rust, rustlang, rust-lang, map_model"><title>map_model - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceSerif4-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../FiraSans-Regular.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../FiraSans-Medium.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceCodePro-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceSerif4-Bold.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../SourceCodePro-Semibold.ttf.woff2"><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../ayu.css"disabled><linkrel="stylesheet"type="text/css"href="../dark.css"disabled><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><scriptid="default-settings"></script><scriptsrc="../storage.js"></script><scriptsrc="../crates.js"></script><scriptdefersrc="../main.js"></script>
<noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="alternate icon"type="image/png"href="../favicon-16x16.png"><linkrel="alternate icon"type="image/png"href="../favicon-32x32.png"><linkrel="icon"type="image/svg+xml"href="../favicon.svg"></head><bodyclass="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="sidebar-logo"href="../map_model/index.html"><divclass="logo-container"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></div>
</a><h2class="location"><ahref="#">Crate map_model</a></h2><divclass="sidebar-elems"><divclass="block"><ul><liclass="version">Version 0.1.0</li><li><aid="all-types"href="all.html">All Items</a></li></div></ul><section><divclass="block"><ul><li><ahref="#modules">Modules</a></li><li><ahref="#structs">Structs</a></li><li><ahref="#enums">Enums</a></li><li><ahref="#constants">Constants</a></li></ul></div></section><divid="sidebar-vars"data-name="map_model"data-ty="mod"data-relpath=""></div><scriptdefersrc="sidebar-items.js"></script></div></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container"href="../map_model/index.html"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></a><navclass="sub"><divclass="theme-picker hidden"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"title="themes"><imgwidth="22"height="22"alt="Pick another theme!"src="../brush.svg"></button><divid="theme-choices"role="menu"></div></div><formclass="search-form"><divclass="search-container"><span></span><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><buttontype="button"id="help-button"title="help">?</button><aid="settings-menu"href="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../wheel.svg"></a></div></form></nav></div><sectionid="main-content"class="content"><divclass="main-heading">
<h1class="fqn"><spanclass="in-band">Crate <aclass="mod"href="#">map_model</a><buttonid="copy-path"onclick="copy_path(this)"title="Copy item path to clipboard"><imgsrc="../clipboard.svg"width="19"height="18"alt="Copy item path"></button></span></h1><spanclass="out-of-band"><aclass="srclink"href="../src/map_model/lib.rs.html#1-117">source</a> · <aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p><code>map_model</code> describes the world where simulations occur. Importing a map from OSM partly happens
<li>lc = lane-change (which is modelled very strangely: <ahref="https://a-b-street.github.io/docs/tech/trafficsim/discrete_event.html#lane-changing">https://a-b-street.github.io/docs/tech/trafficsim/discrete_event.html#lane-changing</a>)</li>
<divclass="item-table"><divclass="item-row"><divclass="item-left import-item"><code>pub use <aclass="mod"href="../raw_map/index.html"title="mod raw_map">raw_map</a> as raw;</code></div><divclass="item-right docblock-short"></div></div></div><h2id="modules"class="small-section-header"><ahref="#modules">Modules</a></h2>
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="city/index.html"title="map_model::city mod">city</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="connectivity/index.html"title="map_model::connectivity mod">connectivity</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="edits/index.html"title="map_model::edits mod">edits</a></div><divclass="item-right docblock-short"><p>Once a Map exists, the player can edit it in the UI (producing <code>MapEdits</code> in-memory), then save
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="make/index.html"title="map_model::make mod">make</a></div><divclass="item-right docblock-short"><p>See <ahref="https://a-b-street.github.io/docs/tech/map/importing/index.html">https://a-b-street.github.io/docs/tech/map/importing/index.html</a> for an overview. This module
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="map/index.html"title="map_model::map mod">map</a></div><divclass="item-right docblock-short"><p>A bunch of (mostly read-only) queries on a Map.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="objects/index.html"title="map_model::objects mod">objects</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="osm/index.html"title="map_model::osm mod">osm</a></div><divclass="item-right docblock-short"><p>Useful utilities for working with OpenStreetMap.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="pathfind/index.html"title="map_model::pathfind mod">pathfind</a></div><divclass="item-right docblock-short"><p>Everything related to pathfinding through a map for different types of agents.</p>
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.AccessRestrictions.html"title="map_model::AccessRestrictions struct">AccessRestrictions</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Amenity.html"title="map_model::Amenity struct">Amenity</a></div><divclass="item-right docblock-short"><p>A business located inside a building.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Area.html"title="map_model::Area struct">Area</a></div><divclass="item-right docblock-short"><p>Areas are just used for drawing.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.AreaID.html"title="map_model::AreaID struct">AreaID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Block.html"title="map_model::Block struct">Block</a></div><divclass="item-right docblock-short"><p>A block is defined by a perimeter that traces along the sides of roads. Inside the perimeter,
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Building.html"title="map_model::Building struct">Building</a></div><divclass="item-right docblock-short"><p>A building has connections to the road and sidewalk, may contain commercial amenities, and have
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.BuildingID.html"title="map_model::BuildingID struct">BuildingID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.City.html"title="map_model::City struct">City</a></div><divclass="item-right docblock-short"><p>A single city (like Seattle) can be broken down into multiple boundary polygons (udistrict,
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.CompressedMovementID.html"title="map_model::CompressedMovementID struct">CompressedMovementID</a></div><divclass="item-right docblock-short"><p>This is cheaper to store than a MovementID. It simply indexes into the list of movements.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ControlStopSign.html"title="map_model::ControlStopSign struct">ControlStopSign</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ControlTrafficSignal.html"title="map_model::ControlTrafficSignal struct">ControlTrafficSignal</a></div><divclass="item-right docblock-short"><p>A traffic signal consists of a sequence of Stages that repeat in a cycle. Most Stages last for a
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.DirectedRoadID.html"title="map_model::DirectedRoadID struct">DirectedRoadID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.EditEffects.html"title="map_model::EditEffects struct">EditEffects</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.EditRoad.html"title="map_model::EditRoad struct">EditRoad</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Intersection.html"title="map_model::Intersection struct">Intersection</a></div><divclass="item-right docblock-short"><p>An intersection connects roads. Most have >2 roads and are controlled by stop signs or traffic
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.IntersectionCluster.html"title="map_model::IntersectionCluster struct">IntersectionCluster</a></div><divclass="item-right docblock-short"><p>This only applies to VehiclePathfinder; walking through these intersections is nothing special.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.IntersectionID.html"title="map_model::IntersectionID struct">IntersectionID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Lane.html"title="map_model::Lane struct">Lane</a></div><divclass="item-right docblock-short"><p>A road segment is broken down into individual lanes, which have a LaneType.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.LaneID.html"title="map_model::LaneID struct">LaneID</a></div><divclass="item-right docblock-short"><p>A lane is identified by its parent road and its position, ordered from the left.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.LaneSpec.html"title="map_model::LaneSpec struct">LaneSpec</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Map.html"title="map_model::Map struct">Map</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.MapConfig.html"title="map_model::MapConfig struct">MapConfig</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.MapEdits.html"title="map_model::MapEdits struct">MapEdits</a></div><divclass="item-right docblock-short"><p>Represents changes to a map. Note this isn’t serializable – that’s what <code>PermanentMapEdits</code>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Movement.html"title="map_model::Movement struct">Movement</a></div><divclass="item-right docblock-short"><p>A Movement groups all turns from one road to another, letting traffic signals and pathfinding
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.MovementID.html"title="map_model::MovementID struct">MovementID</a></div><divclass="item-right docblock-short"><p>A movement is like a turn, but with less detail – it identifies a movement from one directed
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.NamePerLanguage.html"title="map_model::NamePerLanguage struct">NamePerLanguage</a></div><divclass="item-right docblock-short"><p>None corresponds to the native name</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ParkingLot.html"title="map_model::ParkingLot struct">ParkingLot</a></div><divclass="item-right docblock-short"><p>Parking lots have some fixed capacity for cars, and are connected to a sidewalk and road.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ParkingLotID.html"title="map_model::ParkingLotID struct">ParkingLotID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Path.html"title="map_model::Path struct">Path</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.PathRequest.html"title="map_model::PathRequest struct">PathRequest</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.PathV2.html"title="map_model::PathV2 struct">PathV2</a></div><divclass="item-right docblock-short"><p>A path between two endpoints for a particular mode. This representation is immutable and doesn’t
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Pathfinder.html"title="map_model::Pathfinder struct">Pathfinder</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.PathfinderCache.html"title="map_model::PathfinderCache struct">PathfinderCache</a></div><divclass="item-right docblock-short"><p>For callers needing to request paths with a variety of RoutingParams. The caller is in charge
of the lifetime, so they can clear it out when appropriate.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Perimeter.html"title="map_model::Perimeter struct">Perimeter</a></div><divclass="item-right docblock-short"><p>A sequence of roads in order, beginning and ending at the same place. No “crossings” – tracing
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.PermanentMapEdits.html"title="map_model::PermanentMapEdits struct">PermanentMapEdits</a></div><divclass="item-right docblock-short"><p>MapEdits are converted to this before serializing. Referencing things like LaneID in a Map won’t
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Position.html"title="map_model::Position struct">Position</a></div><divclass="item-right docblock-short"><p>Represents a specific point some distance along a lane.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.RawToMapOptions.html"title="map_model::RawToMapOptions struct">RawToMapOptions</a></div><divclass="item-right docblock-short"><p>Options for converting RawMaps to Maps.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Road.html"title="map_model::Road struct">Road</a></div><divclass="item-right docblock-short"><p>A Road represents a segment between exactly two Intersections. It contains Lanes as children.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.RoadID.html"title="map_model::RoadID struct">RoadID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.RoadSideID.html"title="map_model::RoadSideID struct">RoadSideID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.RoadWithStopSign.html"title="map_model::RoadWithStopSign struct">RoadWithStopSign</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.RoutingParams.html"title="map_model::RoutingParams struct">RoutingParams</a></div><divclass="item-right docblock-short"><p>Tuneable parameters for all types of routing.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Stage.html"title="map_model::Stage struct">Stage</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.TransitRoute.html"title="map_model::TransitRoute struct">TransitRoute</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.TransitRouteID.html"title="map_model::TransitRouteID struct">TransitRouteID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.TransitStop.html"title="map_model::TransitStop struct">TransitStop</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.TransitStopID.html"title="map_model::TransitStopID struct">TransitStopID</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Turn.html"title="map_model::Turn struct">Turn</a></div><divclass="item-right docblock-short"><p>A Turn leads from the end of one Lane to the start of another. (Except for pedestrians;
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.TurnID.html"title="map_model::TurnID struct">TurnID</a></div><divclass="item-right docblock-short"><p>Turns are uniquely identified by their (src, dst) lanes and their parent intersection.
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.UberTurn.html"title="map_model::UberTurn struct">UberTurn</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Zone.html"title="map_model::Zone struct">Zone</a></div><divclass="item-right docblock-short"><p>A contiguous set of roads with access restrictions. This is derived from all the map’s roads and
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.AmenityType.html"title="map_model::AmenityType enum">AmenityType</a></div><divclass="item-right docblock-short"><p>Businesses are categorized into one of these types.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.PathConstraints.html"title="map_model::PathConstraints enum">PathConstraints</a></div><divclass="item-right docblock-short"><p>Who’s asking for a path?</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.PathStep.html"title="map_model::PathStep enum">PathStep</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.PathStepV2.html"title="map_model::PathStepV2 enum">PathStepV2</a></div><divclass="item-right docblock-short"><p>One step along a path.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.PathfinderCaching.html"title="map_model::PathfinderCaching enum">PathfinderCaching</a></div><divclass="item-right docblock-short"><p>When pathfinding with different <code>RoutingParams</code> is done, a temporary pathfinder must be
created. This specifies what type of pathfinder and whether to cache it.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.StageType.html"title="map_model::StageType enum">StageType</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Traversable.html"title="map_model::Traversable enum">Traversable</a></div><divclass="item-right docblock-short"><p>Either a lane or a turn, where most movement happens.</p>
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="constant"href="constant.MAX_BIKE_SPEED.html"title="map_model::MAX_BIKE_SPEED constant">MAX_BIKE_SPEED</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="constant"href="constant.MAX_WALKING_SPEED.html"title="map_model::MAX_WALKING_SPEED constant">MAX_WALKING_SPEED</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="constant"href="constant.NORMAL_LANE_THICKNESS.html"title="map_model::NORMAL_LANE_THICKNESS constant">NORMAL_LANE_THICKNESS</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="constant"href="constant.PARKING_LOT_SPOT_LENGTH.html"title="map_model::PARKING_LOT_SPOT_LENGTH constant">PARKING_LOT_SPOT_LENGTH</a></div><divclass="item-right docblock-short"><p>From some manually audited cases in Seattle, the length of parallel street parking spots is a