mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 15:02:59 +03:00
deploy: 02dc473d1e
This commit is contained in:
parent
7e3cc4caf4
commit
efb0f3c57b
@ -270,7 +270,6 @@ a building not explicitly designated in OpenStreetMap as a garage. After editing
|
||||
the JSON, you have to convert it back to the binary format:</p>
|
||||
<pre><code>cargo run --bin json_to_binary_map -- --input=montlake.json out=data/system/seattle/maps/montlake_modified.bin`
|
||||
</code></pre>
|
||||
<p>... Except this tool doesn't seem to work yet!</p>
|
||||
<p>The format of the map isn't well-documented yet. See the
|
||||
<a href="https://dabreegster.github.io/abstreet/rustdoc/map_model/index.html">generated API docs</a>
|
||||
and <a href="../map/index.html">the map model docs</a> in the meantime.</p>
|
||||
|
@ -227,7 +227,7 @@ the only thing you need to change is <code>osm_url</code>.</p>
|
||||
<p>Run it: <code>./import.sh --city=your_city --raw --map</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Update <code>.gitignore</code> and <code>data/regen.sh</code>, following <code>tel_aviv</code> as an example.</p>
|
||||
<p>Update <code>.gitignore</code> and <code>importer/src/main.rs</code>, following <code>tel_aviv</code> as an example.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Fill out <code>nice_map_name</code> in <code>map_gui/src/tools/mod.rs</code>.</p>
|
||||
|
@ -311,7 +311,7 @@ the only thing you need to change is <code>osm_url</code>.</p>
|
||||
<p>Run it: <code>./import.sh --city=your_city --raw --map</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Update <code>.gitignore</code> and <code>data/regen.sh</code>, following <code>tel_aviv</code> as an example.</p>
|
||||
<p>Update <code>.gitignore</code> and <code>importer/src/main.rs</code>, following <code>tel_aviv</code> as an example.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Fill out <code>nice_map_name</code> in <code>map_gui/src/tools/mod.rs</code>.</p>
|
||||
@ -1142,7 +1142,6 @@ a building not explicitly designated in OpenStreetMap as a garage. After editing
|
||||
the JSON, you have to convert it back to the binary format:</p>
|
||||
<pre><code>cargo run --bin json_to_binary_map -- --input=montlake.json out=data/system/seattle/maps/montlake_modified.bin`
|
||||
</code></pre>
|
||||
<p>... Except this tool doesn't seem to work yet!</p>
|
||||
<p>The format of the map isn't well-documented yet. See the
|
||||
<a href="https://dabreegster.github.io/abstreet/rustdoc/map_model/index.html">generated API docs</a>
|
||||
and <a href="dev/../map/index.html">the map model docs</a> in the meantime.</p>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Tue, 19 Jan 2021 19:43:09 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Tue, 19 Jan 2021 22:26:37 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -3,4 +3,4 @@
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../importer/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate importer</p><div class="block version"><p>Version 0.1.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span>
|
||||
</span>
|
||||
<span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.Job.html">Job</a></li><li><a href="actdev/struct.ODSummary.html">actdev::ODSummary</a></li><li><a href="berlin/struct.Record.html">berlin::Record</a></li><li><a href="configuration/struct.ImporterConfiguration.html">configuration::ImporterConfiguration</a></li><li><a href="generic/struct.GenericCityImporter.html">generic::GenericCityImporter</a></li><li><a href="seattle/struct.StopTimeRecord.html">seattle::StopTimeRecord</a></li><li><a href="seattle/struct.TripRecord.html">seattle::TripRecord</a></li></ul><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="actdev/fn.generate_scenario.html">actdev::generate_scenario</a></li><li><a href="actdev/fn.import_scenarios.html">actdev::import_scenarios</a></li><li><a href="actdev/fn.parse_usize.html">actdev::parse_usize</a></li><li><a href="actdev/fn.rand_duration.html">actdev::rand_duration</a></li><li><a href="actdev/fn.rand_time.html">actdev::rand_time</a></li><li><a href="berlin/fn.correlate_population.html">berlin::correlate_population</a></li><li><a href="berlin/fn.distribute_residents.html">berlin::distribute_residents</a></li><li><a href="berlin/fn.import_extra_data.html">berlin::import_extra_data</a></li><li><a href="configuration/fn.load_configuration.html">configuration::load_configuration</a></li><li><a href="dependencies/fn.are_dependencies_callable.html">dependencies::are_dependencies_callable</a></li><li><a href="dependencies/fn.is_program_callable.html">dependencies::is_program_callable</a></li><li><a href="leeds/fn.import_extra_data.html">leeds::import_extra_data</a></li><li><a href="london/fn.import_extra_data.html">london::import_extra_data</a></li><li><a href="fn.main.html">main</a></li><li><a href="fn.oneshot.html">oneshot</a></li><li><a href="seattle/fn.add_gtfs_schedules.html">seattle::add_gtfs_schedules</a></li><li><a href="seattle/fn.adjust_private_parking.html">seattle::adjust_private_parking</a></li><li><a href="seattle/fn.input.html">seattle::input</a></li><li><a href="seattle/fn.match_parcels_to_buildings.html">seattle::match_parcels_to_buildings</a></li><li><a href="seattle/fn.osm_to_raw.html">seattle::osm_to_raw</a></li><li><a href="utils/fn.download.html">utils::download</a></li><li><a href="utils/fn.download_kml.html">utils::download_kml</a></li><li><a href="utils/fn.osmconvert.html">utils::osmconvert</a></li><li><a href="utils/fn.raw_to_map.html">utils::raw_to_map</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
<span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.Job.html">Job</a></li><li><a href="actdev/struct.ODSummary.html">actdev::ODSummary</a></li><li><a href="berlin/struct.Record.html">berlin::Record</a></li><li><a href="configuration/struct.ImporterConfiguration.html">configuration::ImporterConfiguration</a></li><li><a href="generic/struct.GenericCityImporter.html">generic::GenericCityImporter</a></li><li><a href="seattle/struct.StopTimeRecord.html">seattle::StopTimeRecord</a></li><li><a href="seattle/struct.TripRecord.html">seattle::TripRecord</a></li></ul><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="actdev/fn.generate_scenario.html">actdev::generate_scenario</a></li><li><a href="actdev/fn.import_scenarios.html">actdev::import_scenarios</a></li><li><a href="actdev/fn.parse_usize.html">actdev::parse_usize</a></li><li><a href="actdev/fn.rand_duration.html">actdev::rand_duration</a></li><li><a href="actdev/fn.rand_time.html">actdev::rand_time</a></li><li><a href="berlin/fn.correlate_population.html">berlin::correlate_population</a></li><li><a href="berlin/fn.distribute_residents.html">berlin::distribute_residents</a></li><li><a href="berlin/fn.import_extra_data.html">berlin::import_extra_data</a></li><li><a href="configuration/fn.load_configuration.html">configuration::load_configuration</a></li><li><a href="dependencies/fn.are_dependencies_callable.html">dependencies::are_dependencies_callable</a></li><li><a href="dependencies/fn.is_program_callable.html">dependencies::is_program_callable</a></li><li><a href="leeds/fn.import_extra_data.html">leeds::import_extra_data</a></li><li><a href="london/fn.import_extra_data.html">london::import_extra_data</a></li><li><a href="fn.main.html">main</a></li><li><a href="fn.oneshot.html">oneshot</a></li><li><a href="fn.regenerate_everything.html">regenerate_everything</a></li><li><a href="seattle/fn.add_gtfs_schedules.html">seattle::add_gtfs_schedules</a></li><li><a href="seattle/fn.adjust_private_parking.html">seattle::adjust_private_parking</a></li><li><a href="seattle/fn.input.html">seattle::input</a></li><li><a href="seattle/fn.match_parcels_to_buildings.html">seattle::match_parcels_to_buildings</a></li><li><a href="seattle/fn.osm_to_raw.html">seattle::osm_to_raw</a></li><li><a href="utils/fn.download.html">utils::download</a></li><li><a href="utils/fn.download_kml.html">utils::download_kml</a></li><li><a href="utils/fn.osmconvert.html">utils::osmconvert</a></li><li><a href="utils/fn.raw_to_map.html">utils::raw_to_map</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `main` fn in crate `importer`."><meta name="keywords" content="rust, rustlang, rust-lang, main"><title>importer::main - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../importer/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">importer</a></p><script>window.sidebarCurrent = {name: "main", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#45-246" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">importer</a>::<wbr><a class="fn" href="">main</a></span></h1><pre class="rust fn">fn main()</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#27-86" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">importer</a>::<wbr><a class="fn" href="">main</a></span></h1><pre class="rust fn">fn main()</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `oneshot` fn in crate `importer`."><meta name="keywords" content="rust, rustlang, rust-lang, oneshot"><title>importer::oneshot - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../importer/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">importer</a></p><script>window.sidebarCurrent = {name: "oneshot", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#248-291" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">importer</a>::<wbr><a class="fn" href="">oneshot</a></span></h1><pre class="rust fn">fn oneshot(<br> osm_path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <br> clip: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> drive_on_right: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> inferred_sidewalks: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> build_ch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> keep_bldg_tags: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#287-329" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">importer</a>::<wbr><a class="fn" href="">oneshot</a></span></h1><pre class="rust fn">fn oneshot(<br> osm_path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <br> clip: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> drive_on_right: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> build_ch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <br> keep_bldg_tags: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
4
rustdoc/importer/fn.regenerate_everything.html
Normal file
4
rustdoc/importer/fn.regenerate_everything.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `regenerate_everything` fn in crate `importer`."><meta name="keywords" content="rust, rustlang, rust-lang, regenerate_everything"><title>importer::regenerate_everything - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../importer/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">importer</a></p><script>window.sidebarCurrent = {name: "regenerate_everything", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#88-127" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">importer</a>::<wbr><a class="fn" href="">regenerate_everything</a></span></h1><pre class="rust fn">fn regenerate_everything(config: <a class="struct" href="../importer/configuration/struct.ImporterConfiguration.html" title="struct importer::configuration::ImporterConfiguration">ImporterConfiguration</a>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `importer` crate."><meta name="keywords" content="rust, rustlang, rust-lang, importer"><title>importer - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../importer/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate importer</p><div class="block version"><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all importer's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "importer", ty: "mod", relpath: "../"};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#1-291" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">importer</a></span></h1><div class="docblock"><p>It's assumed that the importer is run with the current directory as the project repository; aka
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/importer/main.rs.html#1-329" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">importer</a></span></h1><div class="docblock"><p>It's assumed that the importer is run with the current directory as the project repository; aka
|
||||
<code>./data/</code> and <code>./importer/config</code> must exist.</p>
|
||||
</div><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
|
||||
<table><tr class="module-item"><td><a class="mod" href="actdev/index.html" title="importer::actdev mod">actdev</a></td><td class="docblock-short"><p>This module is used for all cities associated with the https://github.com/cyipt/actdev project.</p>
|
||||
</td></tr><tr class="module-item"><td><a class="mod" href="berlin/index.html" title="importer::berlin mod">berlin</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="configuration/index.html" title="importer::configuration mod">configuration</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="dependencies/index.html" title="importer::dependencies mod">dependencies</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="generic/index.html" title="importer::generic mod">generic</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="leeds/index.html" title="importer::leeds mod">leeds</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="london/index.html" title="importer::london mod">london</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="seattle/index.html" title="importer::seattle mod">seattle</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="utils/index.html" title="importer::utils mod">utils</a></td><td class="docblock-short"></td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.Job.html" title="importer::Job struct">Job</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.main.html" title="importer::main fn">main</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.oneshot.html" title="importer::oneshot fn">oneshot</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.main.html" title="importer::main fn">main</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.oneshot.html" title="importer::oneshot fn">oneshot</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.regenerate_everything.html" title="importer::regenerate_everything fn">regenerate_everything</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "importer";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
@ -1 +1 @@
|
||||
initSidebarItems({"fn":[["main",""],["oneshot",""]],"mod":[["actdev","This module is used for all cities associated with the https://github.com/cyipt/actdev project."],["berlin",""],["configuration",""],["dependencies",""],["generic",""],["leeds",""],["london",""],["seattle",""],["utils",""]],"struct":[["Job",""]]});
|
||||
initSidebarItems({"fn":[["main",""],["oneshot",""],["regenerate_everything",""]],"mod":[["actdev","This module is used for all cities associated with the https://github.com/cyipt/actdev project."],["berlin",""],["configuration",""],["dependencies",""],["generic",""],["leeds",""],["london",""],["seattle",""],["utils",""]],"struct":[["Job",""]]});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -122,7 +122,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.49.0 (e1884a8e3 2020-12-29)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Tue, 19 Jan 2021 19:43:09 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Tue, 19 Jan 2021 22:26:37 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -292,6 +292,44 @@
|
||||
<span id="289">289</span>
|
||||
<span id="290">290</span>
|
||||
<span id="291">291</span>
|
||||
<span id="292">292</span>
|
||||
<span id="293">293</span>
|
||||
<span id="294">294</span>
|
||||
<span id="295">295</span>
|
||||
<span id="296">296</span>
|
||||
<span id="297">297</span>
|
||||
<span id="298">298</span>
|
||||
<span id="299">299</span>
|
||||
<span id="300">300</span>
|
||||
<span id="301">301</span>
|
||||
<span id="302">302</span>
|
||||
<span id="303">303</span>
|
||||
<span id="304">304</span>
|
||||
<span id="305">305</span>
|
||||
<span id="306">306</span>
|
||||
<span id="307">307</span>
|
||||
<span id="308">308</span>
|
||||
<span id="309">309</span>
|
||||
<span id="310">310</span>
|
||||
<span id="311">311</span>
|
||||
<span id="312">312</span>
|
||||
<span id="313">313</span>
|
||||
<span id="314">314</span>
|
||||
<span id="315">315</span>
|
||||
<span id="316">316</span>
|
||||
<span id="317">317</span>
|
||||
<span id="318">318</span>
|
||||
<span id="319">319</span>
|
||||
<span id="320">320</span>
|
||||
<span id="321">321</span>
|
||||
<span id="322">322</span>
|
||||
<span id="323">323</span>
|
||||
<span id="324">324</span>
|
||||
<span id="325">325</span>
|
||||
<span id="326">326</span>
|
||||
<span id="327">327</span>
|
||||
<span id="328">328</span>
|
||||
<span id="329">329</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="doccomment">//! It's assumed that the importer is run with the current directory as the project repository; aka</span>
|
||||
<span class="doccomment">//! `./data/` and `./importer/config` must exist.</span>
|
||||
@ -300,7 +338,7 @@
|
||||
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">anyhow</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">abstio</span>::<span class="ident">MapName</span>;
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::<span class="ident">basename</span>;
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::{<span class="ident">basename</span>, <span class="ident">Timer</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="ident">configuration</span>::{<span class="ident">load_configuration</span>, <span class="ident">ImporterConfiguration</span>};
|
||||
<span class="kw">use</span> <span class="ident">dependencies</span>::<span class="ident">are_dependencies_callable</span>;
|
||||
@ -319,26 +357,37 @@
|
||||
|
||||
<span class="comment">// TODO Might be cleaner to express as a dependency graph?</span>
|
||||
|
||||
<span class="kw">struct</span> <span class="ident">Job</span> {
|
||||
<span class="ident">city</span>: <span class="ident">String</span>,
|
||||
<span class="ident">osm_to_raw</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">raw_to_map</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">scenario</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">city_overview</span>: <span class="ident">bool</span>,
|
||||
|
||||
<span class="ident">skip_ch</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">keep_bldg_tags</span>: <span class="ident">bool</span>,
|
||||
|
||||
<span class="ident">only_map</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||
|
||||
<span class="ident">oneshot</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||
<span class="ident">oneshot_clip</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||
<span class="ident">oneshot_drive_on_left</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">oneshot_dont_infer_sidewalks</span>: <span class="ident">bool</span>,
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">config</span>: <span class="ident">ImporterConfiguration</span> <span class="op">=</span> <span class="ident">load_configuration</span>();
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="ident">are_dependencies_callable</span>(<span class="kw-2">&</span><span class="ident">config</span>) {
|
||||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"One or more dependencies aren't callable. Add them to the path and try again."</span>);
|
||||
<span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">exit</span>(<span class="number">1</span>);
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">args</span> <span class="op">=</span> <span class="ident">abstutil</span>::<span class="ident">CmdArgs</span>::<span class="ident">new</span>();
|
||||
<span class="comment">// Skip the most expensive step of --map, building contraction hierarchies. The simulation</span>
|
||||
<span class="comment">// will use a slower method to pathfind.</span>
|
||||
<span class="kw">let</span> <span class="ident">skip_ch</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--skip_ch"</span>);
|
||||
<span class="comment">// Preserve OSM tags for buildings, increasing the file size.</span>
|
||||
<span class="kw">let</span> <span class="ident">keep_bldg_tags</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--keep_bldg_tags"</span>);
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="op">=</span> <span class="ident">args</span>.<span class="ident">optional</span>(<span class="string">"--oneshot"</span>) {
|
||||
<span class="kw">let</span> <span class="ident">clip</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">optional</span>(<span class="string">"--oneshot_clip"</span>);
|
||||
<span class="kw">let</span> <span class="ident">drive_on_left</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--oneshot_drive_on_left"</span>);
|
||||
<span class="ident">args</span>.<span class="ident">done</span>();
|
||||
|
||||
<span class="ident">oneshot</span>(<span class="ident">path</span>, <span class="ident">clip</span>, <span class="op">!</span><span class="ident">drive_on_left</span>, <span class="op">!</span><span class="ident">skip_ch</span>, <span class="ident">keep_bldg_tags</span>);
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--regen_all"</span>) {
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">skip_ch</span>);
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">keep_bldg_tags</span>);
|
||||
<span class="ident">regenerate_everything</span>(<span class="ident">config</span>);
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
|
||||
<span class="comment">// Otherwise, we're just operating on a single city.</span>
|
||||
<span class="kw">let</span> <span class="ident">job</span> <span class="op">=</span> <span class="ident">Job</span> {
|
||||
<span class="ident">city</span>: <span class="ident">args</span>.<span class="ident">optional</span>(<span class="string">"--city"</span>).<span class="ident">unwrap_or</span>(<span class="string">"seattle"</span>.<span class="ident">to_string</span>()),
|
||||
<span class="comment">// Download all raw input files, then convert OSM to the intermediate RawMap.</span>
|
||||
@ -349,29 +398,14 @@
|
||||
<span class="ident">scenario</span>: <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--scenario"</span>),
|
||||
<span class="comment">// Produce a city overview from all of the individual maps in a city.</span>
|
||||
<span class="ident">city_overview</span>: <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--city_overview"</span>),
|
||||
<span class="comment">// Skip the most expensive step of --map, building contraction hierarchies. The simulation</span>
|
||||
<span class="comment">// will use a slower method to pathfind.</span>
|
||||
<span class="ident">skip_ch</span>: <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--skip_ch"</span>),
|
||||
<span class="comment">// Preserve OSM tags for buildings, increasing the file size.</span>
|
||||
<span class="ident">keep_bldg_tags</span>: <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--keep_bldg_tags"</span>),
|
||||
|
||||
<span class="comment">// Only process one map. If not specified, process all maps defined by clipping polygons in</span>
|
||||
<span class="comment">// importer/config/$city/.</span>
|
||||
<span class="ident">only_map</span>: <span class="ident">args</span>.<span class="ident">optional_free</span>(),
|
||||
|
||||
<span class="comment">// Ignore other arguments and just convert the given .osm file to a Map.</span>
|
||||
<span class="ident">oneshot</span>: <span class="ident">args</span>.<span class="ident">optional</span>(<span class="string">"--oneshot"</span>),
|
||||
<span class="ident">oneshot_clip</span>: <span class="ident">args</span>.<span class="ident">optional</span>(<span class="string">"--oneshot_clip"</span>),
|
||||
<span class="ident">oneshot_drive_on_left</span>: <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--oneshot_drive_on_left"</span>),
|
||||
<span class="ident">oneshot_dont_infer_sidewalks</span>: <span class="ident">args</span>.<span class="ident">enabled</span>(<span class="string">"--oneshot_dont_infer_sidewalks"</span>),
|
||||
};
|
||||
<span class="ident">args</span>.<span class="ident">done</span>();
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">osm_to_raw</span>
|
||||
<span class="op">&&</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">raw_to_map</span>
|
||||
<span class="op">&&</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">scenario</span>
|
||||
<span class="op">&&</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">city_overview</span>
|
||||
<span class="op">&&</span> <span class="ident">job</span>.<span class="ident">oneshot</span>.<span class="ident">is_none</span>()
|
||||
{
|
||||
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">osm_to_raw</span> <span class="op">&&</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">raw_to_map</span> <span class="op">&&</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">scenario</span> <span class="op">&&</span> <span class="op">!</span><span class="ident">job</span>.<span class="ident">city_overview</span> {
|
||||
<span class="macro">println</span><span class="macro">!</span>(
|
||||
<span class="string">"Nothing to do! Pass some combination of --raw, --map, --scenario, --city_overview, \
|
||||
or --oneshot"</span>
|
||||
@ -379,164 +413,207 @@
|
||||
<span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">exit</span>(<span class="number">1</span>);
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">config</span>: <span class="ident">ImporterConfiguration</span> <span class="op">=</span> <span class="ident">load_configuration</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">"import map data"</span>);
|
||||
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">osm_to_raw</span> {
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="ident">are_dependencies_callable</span>(<span class="kw-2">&</span><span class="ident">config</span>) {
|
||||
<span class="macro">println</span><span class="macro">!</span>(
|
||||
<span class="string">"One or more dependencies aren't callable. Add them to the path and try again."</span>
|
||||
);
|
||||
<span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">exit</span>(<span class="number">1</span>);
|
||||
<span class="ident">job</span>.<span class="ident">run</span>(<span class="kw-2">&</span><span class="ident">config</span>, <span class="ident">skip_ch</span>, <span class="ident">keep_bldg_tags</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">regenerate_everything</span>(<span class="ident">config</span>: <span class="ident">ImporterConfiguration</span>) {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">"regenerate all maps"</span>);
|
||||
<span class="kw">for</span> <span class="ident">city</span> <span class="kw">in</span> <span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="string">"seattle"</span>,
|
||||
<span class="string">"bellevue"</span>,
|
||||
<span class="string">"berlin"</span>,
|
||||
<span class="string">"cambridge"</span>,
|
||||
<span class="string">"cheshire"</span>,
|
||||
<span class="string">"detroit"</span>,
|
||||
<span class="string">"krakow"</span>,
|
||||
<span class="string">"leeds"</span>,
|
||||
<span class="string">"london"</span>,
|
||||
<span class="string">"nyc"</span>,
|
||||
<span class="string">"paris"</span>,
|
||||
<span class="string">"salzburg"</span>,
|
||||
<span class="string">"tel_aviv"</span>,
|
||||
<span class="string">"warsaw"</span>,
|
||||
<span class="string">"xian"</span>,
|
||||
] {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">job</span> <span class="op">=</span> <span class="ident">Job</span> {
|
||||
<span class="ident">city</span>: <span class="ident">city</span>.<span class="ident">to_string</span>(),
|
||||
<span class="ident">osm_to_raw</span>: <span class="bool-val">true</span>,
|
||||
<span class="ident">raw_to_map</span>: <span class="bool-val">true</span>,
|
||||
<span class="ident">scenario</span>: <span class="bool-val">false</span>,
|
||||
<span class="ident">city_overview</span>: <span class="bool-val">false</span>,
|
||||
<span class="ident">only_map</span>: <span class="prelude-val">None</span>,
|
||||
};
|
||||
<span class="comment">// Only some maps run extra tasks</span>
|
||||
<span class="kw">if</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"cambridge"</span> {
|
||||
<span class="ident">job</span>.<span class="ident">scenario</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
}
|
||||
<span class="kw">if</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"nyc"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"paris"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"salzburg"</span> {
|
||||
<span class="ident">job</span>.<span class="ident">city_overview</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">skip_ch</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="kw">let</span> <span class="ident">keep_bldg_tags</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="ident">job</span>.<span class="ident">run</span>(<span class="kw-2">&</span><span class="ident">config</span>, <span class="ident">skip_ch</span>, <span class="ident">keep_bldg_tags</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="op">=</span> <span class="ident">job</span>.<span class="ident">oneshot</span> {
|
||||
<span class="ident">oneshot</span>(
|
||||
<span class="ident">path</span>,
|
||||
<span class="ident">job</span>.<span class="ident">oneshot_clip</span>,
|
||||
<span class="op">!</span><span class="ident">job</span>.<span class="ident">oneshot_drive_on_left</span>,
|
||||
<span class="op">!</span><span class="ident">job</span>.<span class="ident">oneshot_dont_infer_sidewalks</span>,
|
||||
<span class="op">!</span><span class="ident">job</span>.<span class="ident">skip_ch</span>,
|
||||
<span class="ident">job</span>.<span class="ident">keep_bldg_tags</span>,
|
||||
);
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="kw">struct</span> <span class="ident">Job</span> {
|
||||
<span class="ident">city</span>: <span class="ident">String</span>,
|
||||
<span class="ident">osm_to_raw</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">raw_to_map</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">scenario</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">city_overview</span>: <span class="ident">bool</span>,
|
||||
|
||||
<span class="kw">let</span> <span class="ident">names</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">n</span>) <span class="op">=</span> <span class="ident">job</span>.<span class="ident">only_map</span> {
|
||||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"- Just working on {}"</span>, <span class="ident">n</span>);
|
||||
<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">n</span>]
|
||||
} <span class="kw">else</span> {
|
||||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"- Working on all {} maps"</span>, <span class="ident">job</span>.<span class="ident">city</span>);
|
||||
<span class="ident">abstio</span>::<span class="ident">list_dir</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"importer/config/{}"</span>, <span class="ident">job</span>.<span class="ident">city</span>))
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">path</span><span class="op">|</span> <span class="ident">path</span>.<span class="ident">ends_with</span>(<span class="string">".poly"</span>))
|
||||
.<span class="ident">map</span>(<span class="ident">basename</span>)
|
||||
.<span class="ident">collect</span>()
|
||||
};
|
||||
<span class="ident">only_map</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">abstutil</span>::<span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">"import map data"</span>);
|
||||
|
||||
<span class="kw">let</span> (<span class="ident">maybe_popdat</span>, <span class="ident">maybe_huge_map</span>) <span class="op">=</span> <span class="kw">if</span> <span class="ident">job</span>.<span class="ident">scenario</span> {
|
||||
<span class="comment">// TODO This is getting messy!</span>
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"cambridge"</span> {
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">None</span>)
|
||||
<span class="kw">impl</span> <span class="ident">Job</span> {
|
||||
<span class="kw">fn</span> <span class="ident">run</span>(
|
||||
<span class="self">self</span>,
|
||||
<span class="ident">config</span>: <span class="kw-2">&</span><span class="ident">ImporterConfiguration</span>,
|
||||
<span class="ident">skip_ch</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">keep_bldg_tags</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">timer</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Timer</span>,
|
||||
) {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"import {}"</span>, <span class="self">self</span>.<span class="ident">city</span>));
|
||||
<span class="kw">let</span> <span class="ident">names</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">n</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">only_map</span> {
|
||||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"- Just working on {}"</span>, <span class="ident">n</span>);
|
||||
<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">n</span>]
|
||||
} <span class="kw">else</span> {
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">job</span>.<span class="ident">city</span>, <span class="string">"seattle"</span>);
|
||||
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"scenarios"</span>)]</span>
|
||||
{
|
||||
<span class="kw">let</span> (<span class="ident">popdat</span>, <span class="ident">huge_map</span>) <span class="op">=</span> <span class="ident">seattle</span>::<span class="ident">ensure_popdat_exists</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>, <span class="kw-2">&</span><span class="ident">config</span>);
|
||||
(<span class="prelude-val">Some</span>(<span class="ident">popdat</span>), <span class="prelude-val">Some</span>(<span class="ident">huge_map</span>))
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"scenarios"</span>))]</span>
|
||||
{
|
||||
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Can't do --scenario without the scenarios feature compiled in"</span>);
|
||||
<span class="comment">// Nonsense to make the type-checker work</span>
|
||||
(<span class="prelude-val">Some</span>(<span class="bool-val">true</span>), <span class="prelude-val">Some</span>(<span class="bool-val">true</span>))
|
||||
}
|
||||
}
|
||||
} <span class="kw">else</span> {
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">None</span>)
|
||||
};
|
||||
|
||||
<span class="kw">for</span> <span class="ident">name</span> <span class="kw">in</span> <span class="ident">names</span> {
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">osm_to_raw</span> {
|
||||
<span class="comment">// Still special-cased</span>
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> {
|
||||
<span class="ident">seattle</span>::<span class="ident">osm_to_raw</span>(<span class="kw-2">&</span><span class="ident">name</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>, <span class="kw-2">&</span><span class="ident">config</span>);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">let</span> <span class="ident">raw</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">abstio</span>::<span class="ident">maybe_read_json</span>::<span class="op"><</span><span class="ident">generic</span>::<span class="ident">GenericCityImporter</span><span class="op">></span>(
|
||||
<span class="macro">format</span><span class="macro">!</span>(<span class="string">"importer/config/{}/cfg.json"</span>, <span class="ident">job</span>.<span class="ident">city</span>),
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>,
|
||||
) {
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">city_cfg</span>) <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">city_cfg</span>.<span class="ident">osm_to_raw</span>(<span class="ident">MapName</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">job</span>.<span class="ident">city</span>, <span class="kw-2">&</span><span class="ident">name</span>), <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>, <span class="kw-2">&</span><span class="ident">config</span>)
|
||||
}
|
||||
<span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span><span class="op">></span> {
|
||||
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Can't import city {}: {}"</span>, <span class="ident">job</span>.<span class="ident">city</span>, <span class="ident">err</span>);
|
||||
}
|
||||
};
|
||||
|
||||
<span class="kw">match</span> <span class="ident">job</span>.<span class="ident">city</span>.<span class="ident">as_ref</span>() {
|
||||
<span class="string">"berlin"</span> <span class="op">=</span><span class="op">></span> <span class="ident">berlin</span>::<span class="ident">import_extra_data</span>(<span class="kw-2">&</span><span class="ident">raw</span>, <span class="kw-2">&</span><span class="ident">config</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>),
|
||||
<span class="string">"leeds"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">if</span> <span class="ident">name</span> <span class="op">=</span><span class="op">=</span> <span class="string">"huge"</span> {
|
||||
<span class="ident">leeds</span>::<span class="ident">import_extra_data</span>(<span class="kw-2">&</span><span class="ident">raw</span>, <span class="kw-2">&</span><span class="ident">config</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
|
||||
}
|
||||
}
|
||||
<span class="string">"london"</span> <span class="op">=</span><span class="op">></span> <span class="ident">london</span>::<span class="ident">import_extra_data</span>(<span class="kw-2">&</span><span class="ident">raw</span>, <span class="kw-2">&</span><span class="ident">config</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>),
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">name</span> <span class="op">=</span> <span class="ident">MapName</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">job</span>.<span class="ident">city</span>, <span class="kw-2">&</span><span class="ident">name</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">maybe_map</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">job</span>.<span class="ident">raw_to_map</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">utils</span>::<span class="ident">raw_to_map</span>(<span class="kw-2">&</span><span class="ident">name</span>, <span class="op">!</span><span class="ident">job</span>.<span class="ident">skip_ch</span>, <span class="ident">job</span>.<span class="ident">keep_bldg_tags</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
|
||||
|
||||
<span class="comment">// Another strange step in the pipeline.</span>
|
||||
<span class="kw">if</span> <span class="ident">name</span> <span class="op">=</span><span class="op">=</span> <span class="ident">MapName</span>::<span class="ident">new</span>(<span class="string">"berlin"</span>, <span class="string">"center"</span>) {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"distribute residents from planning areas for {}"</span>,
|
||||
<span class="ident">name</span>.<span class="ident">describe</span>()
|
||||
));
|
||||
<span class="ident">berlin</span>::<span class="ident">distribute_residents</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">map</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"distribute residents from planning areas for {}"</span>,
|
||||
<span class="ident">name</span>.<span class="ident">describe</span>()
|
||||
));
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">name</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"add GTFS schedules for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="ident">seattle</span>::<span class="ident">add_gtfs_schedules</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">map</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"add GTFS schedules for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
}
|
||||
|
||||
<span class="prelude-val">Some</span>(<span class="ident">map</span>)
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">job</span>.<span class="ident">scenario</span> {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>))
|
||||
} <span class="kw">else</span> {
|
||||
<span class="prelude-val">None</span>
|
||||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"- Working on all {} maps"</span>, <span class="self">self</span>.<span class="ident">city</span>);
|
||||
<span class="ident">abstio</span>::<span class="ident">list_dir</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"importer/config/{}"</span>, <span class="self">self</span>.<span class="ident">city</span>))
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">path</span><span class="op">|</span> <span class="ident">path</span>.<span class="ident">ends_with</span>(<span class="string">".poly"</span>))
|
||||
.<span class="ident">map</span>(<span class="ident">basename</span>)
|
||||
.<span class="ident">collect</span>()
|
||||
};
|
||||
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">scenario</span> {
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"scenarios"</span>)]</span>
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"scenario for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="kw">let</span> <span class="ident">scenario</span> <span class="op">=</span> <span class="ident">soundcast</span>::<span class="ident">make_weekday_scenario</span>(
|
||||
<span class="ident">maybe_map</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="ident">maybe_popdat</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="ident">maybe_huge_map</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>,
|
||||
);
|
||||
<span class="ident">scenario</span>.<span class="ident">save</span>();
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"scenario for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="kw">let</span> (<span class="ident">maybe_popdat</span>, <span class="ident">maybe_huge_map</span>) <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">scenario</span> {
|
||||
<span class="comment">// TODO This is getting messy!</span>
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"cambridge"</span> {
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">None</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">city</span>, <span class="string">"seattle"</span>);
|
||||
|
||||
<span class="comment">// This is a strange ordering.</span>
|
||||
<span class="kw">if</span> <span class="ident">name</span>.<span class="ident">map</span> <span class="op">=</span><span class="op">=</span> <span class="string">"downtown"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">name</span>.<span class="ident">map</span> <span class="op">=</span><span class="op">=</span> <span class="string">"south_seattle"</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"adjust parking for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="ident">seattle</span>::<span class="ident">adjust_private_parking</span>(<span class="ident">maybe_map</span>.<span class="ident">as_mut</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span><span class="ident">scenario</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"adjust parking for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"scenarios"</span>)]</span>
|
||||
{
|
||||
<span class="kw">let</span> (<span class="ident">popdat</span>, <span class="ident">huge_map</span>) <span class="op">=</span> <span class="ident">seattle</span>::<span class="ident">ensure_popdat_exists</span>(<span class="ident">timer</span>, <span class="ident">config</span>);
|
||||
(<span class="prelude-val">Some</span>(<span class="ident">popdat</span>), <span class="prelude-val">Some</span>(<span class="ident">huge_map</span>))
|
||||
}
|
||||
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="string">"match parcels to buildings"</span>);
|
||||
<span class="ident">seattle</span>::<span class="ident">match_parcels_to_buildings</span>(<span class="ident">maybe_map</span>.<span class="ident">as_mut</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="string">"match parcels to buildings"</span>);
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"scenarios"</span>))]</span>
|
||||
{
|
||||
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Can't do --scenario without the scenarios feature compiled in"</span>);
|
||||
<span class="comment">// Nonsense to make the type-checker work</span>
|
||||
(<span class="prelude-val">Some</span>(<span class="bool-val">true</span>), <span class="prelude-val">Some</span>(<span class="bool-val">true</span>))
|
||||
}
|
||||
}
|
||||
} <span class="kw">else</span> {
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">None</span>)
|
||||
};
|
||||
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"cambridge"</span> {
|
||||
<span class="ident">actdev</span>::<span class="ident">import_scenarios</span>(<span class="ident">maybe_map</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span><span class="ident">config</span>).<span class="ident">unwrap</span>();
|
||||
<span class="kw">for</span> <span class="ident">name</span> <span class="kw">in</span> <span class="ident">names</span> {
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">osm_to_raw</span> {
|
||||
<span class="comment">// Still special-cased</span>
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> {
|
||||
<span class="ident">seattle</span>::<span class="ident">osm_to_raw</span>(<span class="kw-2">&</span><span class="ident">name</span>, <span class="ident">timer</span>, <span class="ident">config</span>);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">let</span> <span class="ident">raw</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">abstio</span>::<span class="ident">maybe_read_json</span>::<span class="op"><</span><span class="ident">generic</span>::<span class="ident">GenericCityImporter</span><span class="op">></span>(
|
||||
<span class="macro">format</span><span class="macro">!</span>(<span class="string">"importer/config/{}/cfg.json"</span>, <span class="self">self</span>.<span class="ident">city</span>),
|
||||
<span class="ident">timer</span>,
|
||||
) {
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">city_cfg</span>) <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">city_cfg</span>.<span class="ident">osm_to_raw</span>(<span class="ident">MapName</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">city</span>, <span class="kw-2">&</span><span class="ident">name</span>), <span class="ident">timer</span>, <span class="ident">config</span>)
|
||||
}
|
||||
<span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span><span class="op">></span> {
|
||||
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Can't import city {}: {}"</span>, <span class="self">self</span>.<span class="ident">city</span>, <span class="ident">err</span>);
|
||||
}
|
||||
};
|
||||
|
||||
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">city</span>.<span class="ident">as_ref</span>() {
|
||||
<span class="string">"berlin"</span> <span class="op">=</span><span class="op">></span> <span class="ident">berlin</span>::<span class="ident">import_extra_data</span>(<span class="kw-2">&</span><span class="ident">raw</span>, <span class="ident">config</span>, <span class="ident">timer</span>),
|
||||
<span class="string">"leeds"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">if</span> <span class="ident">name</span> <span class="op">=</span><span class="op">=</span> <span class="string">"huge"</span> {
|
||||
<span class="ident">leeds</span>::<span class="ident">import_extra_data</span>(<span class="kw-2">&</span><span class="ident">raw</span>, <span class="ident">config</span>, <span class="ident">timer</span>);
|
||||
}
|
||||
}
|
||||
<span class="string">"london"</span> <span class="op">=</span><span class="op">></span> <span class="ident">london</span>::<span class="ident">import_extra_data</span>(<span class="kw-2">&</span><span class="ident">raw</span>, <span class="ident">config</span>, <span class="ident">timer</span>),
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">name</span> <span class="op">=</span> <span class="ident">MapName</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">city</span>, <span class="kw-2">&</span><span class="ident">name</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">maybe_map</span> <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">raw_to_map</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">utils</span>::<span class="ident">raw_to_map</span>(<span class="kw-2">&</span><span class="ident">name</span>, <span class="op">!</span><span class="ident">skip_ch</span>, <span class="ident">keep_bldg_tags</span>, <span class="ident">timer</span>);
|
||||
|
||||
<span class="comment">// Another strange step in the pipeline.</span>
|
||||
<span class="kw">if</span> <span class="ident">name</span> <span class="op">=</span><span class="op">=</span> <span class="ident">MapName</span>::<span class="ident">new</span>(<span class="string">"berlin"</span>, <span class="string">"center"</span>) {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"distribute residents from planning areas for {}"</span>,
|
||||
<span class="ident">name</span>.<span class="ident">describe</span>()
|
||||
));
|
||||
<span class="ident">berlin</span>::<span class="ident">distribute_residents</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">map</span>, <span class="ident">timer</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"distribute residents from planning areas for {}"</span>,
|
||||
<span class="ident">name</span>.<span class="ident">describe</span>()
|
||||
));
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">name</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"add GTFS schedules for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="ident">seattle</span>::<span class="ident">add_gtfs_schedules</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">map</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"add GTFS schedules for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
}
|
||||
|
||||
<span class="prelude-val">Some</span>(<span class="ident">map</span>)
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">scenario</span> {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>))
|
||||
} <span class="kw">else</span> {
|
||||
<span class="prelude-val">None</span>
|
||||
};
|
||||
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">scenario</span> {
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"scenarios"</span>)]</span>
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"seattle"</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"scenario for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="kw">let</span> <span class="ident">scenario</span> <span class="op">=</span> <span class="ident">soundcast</span>::<span class="ident">make_weekday_scenario</span>(
|
||||
<span class="ident">maybe_map</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="ident">maybe_popdat</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="ident">maybe_huge_map</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="ident">timer</span>,
|
||||
);
|
||||
<span class="ident">scenario</span>.<span class="ident">save</span>();
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"scenario for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
|
||||
<span class="comment">// This is a strange ordering.</span>
|
||||
<span class="kw">if</span> <span class="ident">name</span>.<span class="ident">map</span> <span class="op">=</span><span class="op">=</span> <span class="string">"downtown"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">name</span>.<span class="ident">map</span> <span class="op">=</span><span class="op">=</span> <span class="string">"south_seattle"</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"adjust parking for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
<span class="ident">seattle</span>::<span class="ident">adjust_private_parking</span>(<span class="ident">maybe_map</span>.<span class="ident">as_mut</span>().<span class="ident">unwrap</span>(), <span class="kw-2">&</span><span class="ident">scenario</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"adjust parking for {}"</span>, <span class="ident">name</span>.<span class="ident">describe</span>()));
|
||||
}
|
||||
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="string">"match parcels to buildings"</span>);
|
||||
<span class="ident">seattle</span>::<span class="ident">match_parcels_to_buildings</span>(<span class="ident">maybe_map</span>.<span class="ident">as_mut</span>().<span class="ident">unwrap</span>(), <span class="ident">timer</span>);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="string">"match parcels to buildings"</span>);
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="string">"cambridge"</span> {
|
||||
<span class="ident">actdev</span>::<span class="ident">import_scenarios</span>(<span class="ident">maybe_map</span>.<span class="ident">as_ref</span>().<span class="ident">unwrap</span>(), <span class="ident">config</span>).<span class="ident">unwrap</span>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="ident">job</span>.<span class="ident">city_overview</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"generate city overview for {}"</span>, <span class="ident">job</span>.<span class="ident">city</span>));
|
||||
<span class="ident">abstio</span>::<span class="ident">write_binary</span>(
|
||||
<span class="ident">abstio</span>::<span class="ident">path</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"system/{}/city.bin"</span>, <span class="ident">job</span>.<span class="ident">city</span>)),
|
||||
<span class="kw-2">&</span><span class="ident">map_model</span>::<span class="ident">City</span>::<span class="ident">from_individual_maps</span>(<span class="kw-2">&</span><span class="ident">job</span>.<span class="ident">city</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">timer</span>),
|
||||
);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"generate city overview for {}"</span>, <span class="ident">job</span>.<span class="ident">city</span>));
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">city_overview</span> {
|
||||
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"generate city overview for {}"</span>, <span class="self">self</span>.<span class="ident">city</span>));
|
||||
<span class="ident">abstio</span>::<span class="ident">write_binary</span>(
|
||||
<span class="ident">abstio</span>::<span class="ident">path</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"system/{}/city.bin"</span>, <span class="self">self</span>.<span class="ident">city</span>)),
|
||||
<span class="kw-2">&</span><span class="ident">map_model</span>::<span class="ident">City</span>::<span class="ident">from_individual_maps</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">city</span>, <span class="ident">timer</span>),
|
||||
);
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"generate city overview for {}"</span>, <span class="self">self</span>.<span class="ident">city</span>));
|
||||
}
|
||||
|
||||
<span class="ident">timer</span>.<span class="ident">stop</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"import {}"</span>, <span class="self">self</span>.<span class="ident">city</span>));
|
||||
}
|
||||
}
|
||||
|
||||
@ -544,7 +621,6 @@
|
||||
<span class="ident">osm_path</span>: <span class="ident">String</span>,
|
||||
<span class="ident">clip</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||
<span class="ident">drive_on_right</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">inferred_sidewalks</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">build_ch</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">keep_bldg_tags</span>: <span class="ident">bool</span>,
|
||||
) {
|
||||
@ -564,7 +640,7 @@
|
||||
<span class="ident">map_model</span>::<span class="ident">DrivingSide</span>::<span class="ident">Left</span>
|
||||
},
|
||||
<span class="ident">bikes_can_use_bus_lanes</span>: <span class="bool-val">true</span>,
|
||||
<span class="ident">inferred_sidewalks</span>,
|
||||
<span class="ident">inferred_sidewalks</span>: <span class="bool-val">true</span>,
|
||||
<span class="ident">separate_cycleways</span>: <span class="bool-val">false</span>,
|
||||
},
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user