mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-29 04:35:51 +03:00
deploy: ef95252f4b
This commit is contained in:
parent
21cf0b0348
commit
0a83fe2539
@ -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 `clip` fn in crate `clip_osm`."><meta name="keywords" content="rust, rustlang, rust-lang, clip"><title>clip_osm::clip - 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='../clip_osm/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">clip_osm</a></p><script>window.sidebarCurrent = {name: "clip", 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><button type="button" class="help-button">?</button>
|
||||
<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/clip_osm/clip_osm.rs.html#33-107" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">clip_osm</a>::<wbr><a class="fn" href="">clip</a></span></h1><pre class="rust fn">pub(crate) fn clip(<br> pbf_path: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> boundary: &Polygon<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>>, <br> out_path: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="type" href="https://docs.rs/anyhow/1.0.38/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "clip_osm";</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/clip_osm/clip_osm.rs.html#33-117" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">clip_osm</a>::<wbr><a class="fn" href="">clip</a></span></h1><pre class="rust fn">pub(crate) fn clip(<br> pbf_path: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> boundary: &Polygon<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>>, <br> out_path: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> <a class="type" href="https://docs.rs/anyhow/1.0.38/anyhow/type.Result.html" title="type anyhow::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "clip_osm";</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 `to_pt` fn in crate `clip_osm`."><meta name="keywords" content="rust, rustlang, rust-lang, to_pt"><title>clip_osm::to_pt - 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='../clip_osm/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">clip_osm</a></p><script>window.sidebarCurrent = {name: "to_pt", 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><button type="button" class="help-button">?</button>
|
||||
<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/clip_osm/clip_osm.rs.html#109-112" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">clip_osm</a>::<wbr><a class="fn" href="">to_pt</a></span></h1><pre class="rust fn">pub(crate) fn to_pt(pair: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Lat, Lon<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>) -> Point<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "clip_osm";</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/clip_osm/clip_osm.rs.html#119-122" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">clip_osm</a>::<wbr><a class="fn" href="">to_pt</a></span></h1><pre class="rust fn">pub(crate) fn to_pt(pair: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Lat, Lon<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>) -> Point<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "clip_osm";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
@ -1,7 +1,7 @@
|
||||
<!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 `clip_osm` crate."><meta name="keywords" content="rust, rustlang, rust-lang, clip_osm"><title>clip_osm - 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='../clip_osm/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate clip_osm</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 clip_osm's items</p></a><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "clip_osm", 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><button type="button" class="help-button">?</button>
|
||||
<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/clip_osm/clip_osm.rs.html#1-112" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">clip_osm</a></span></h1><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<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/clip_osm/clip_osm.rs.html#1-122" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">clip_osm</a></span></h1><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.clip.html" title="clip_osm::clip fn">clip</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.main.html" title="clip_osm::main fn">main</a></td><td class="docblock-short"><p>Clips an .osm.pbf specified by <code>--pbf</code> using the Osmosis boundary polygon specified by
|
||||
<code>--clip</code>, writing the result as .osm.xml to <code>--out</code>. This is a simple Rust port of <code>osmconvert large_map.osm -B=clipping.poly --complete-ways -o=smaller_map.osm</code>.</p>
|
||||
</td></tr><tr class="module-item"><td><a class="fn" href="fn.to_pt.html" title="clip_osm::to_pt fn">to_pt</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 = "clip_osm";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
@ -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><button type="button" class="help-button">?</button>
|
||||
<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-a95c4551e63dceca/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> = "Mon, 15 Mar 2021 18:07:17 +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-a95c4551e63dceca/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> = "Mon, 15 Mar 2021 18:18:23 +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>
|
@ -113,8 +113,18 @@
|
||||
<span id="110">110</span>
|
||||
<span id="111">111</span>
|
||||
<span id="112">112</span>
|
||||
<span id="113">113</span>
|
||||
<span id="114">114</span>
|
||||
<span id="115">115</span>
|
||||
<span id="116">116</span>
|
||||
<span id="117">117</span>
|
||||
<span id="118">118</span>
|
||||
<span id="119">119</span>
|
||||
<span id="120">120</span>
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::{<span class="ident">BufRead</span>, <span class="ident">BufReader</span>, <span class="ident">BufWriter</span>, <span class="ident">Write</span>};
|
||||
|
||||
@ -158,17 +168,19 @@
|
||||
<span class="kw">match</span> <span class="ident">obj</span>.<span class="ident">object_type</span>() {
|
||||
<span class="ident">OSMObjectType</span>::<span class="ident">Node</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">node</span> <span class="op">=</span> <span class="ident">obj</span>.<span class="ident">into_node</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">pt</span>) <span class="op">=</span> <span class="ident">node</span>.<span class="ident">lat_lon</span>() {
|
||||
<span class="comment">// TODO Include all nodes belonging to ways that're partly in-bounds.</span>
|
||||
<span class="kw">if</span> <span class="ident">boundary</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">to_pt</span>(<span class="ident">pt</span>)) {
|
||||
<span class="ident">nodes</span>.<span class="ident">insert</span>(<span class="ident">node</span>.<span class="ident">id</span>(), <span class="ident">node</span>);
|
||||
}
|
||||
<span class="kw">if</span> <span class="ident">node</span>.<span class="ident">lat_lon</span>().<span class="ident">is_some</span>() {
|
||||
<span class="ident">nodes</span>.<span class="ident">insert</span>(<span class="ident">node</span>.<span class="ident">id</span>(), <span class="ident">node</span>);
|
||||
}
|
||||
}
|
||||
<span class="ident">OSMObjectType</span>::<span class="ident">Way</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="comment">// Assume all nodes appear before any way.</span>
|
||||
<span class="kw">let</span> <span class="ident">way</span> <span class="op">=</span> <span class="ident">obj</span>.<span class="ident">into_way</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">if</span> <span class="ident">way</span>.<span class="ident">nodes</span>().<span class="ident">iter</span>().<span class="ident">any</span>(<span class="op">|</span><span class="ident">id</span><span class="op">|</span> <span class="ident">nodes</span>.<span class="ident">contains_key</span>(<span class="ident">id</span>)) {
|
||||
<span class="kw">if</span> <span class="ident">way</span>.<span class="ident">nodes</span>().<span class="ident">iter</span>().<span class="ident">any</span>(<span class="op">|</span><span class="ident">id</span><span class="op">|</span> {
|
||||
<span class="ident">nodes</span>
|
||||
.<span class="ident">get</span>(<span class="ident">id</span>)
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">n</span><span class="op">|</span> <span class="ident">boundary</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">to_pt</span>(<span class="ident">n</span>.<span class="ident">lat_lon</span>().<span class="ident">unwrap</span>())))
|
||||
.<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>)
|
||||
}) {
|
||||
<span class="ident">ways</span>.<span class="ident">insert</span>(<span class="ident">way</span>.<span class="ident">id</span>(), <span class="ident">way</span>);
|
||||
}
|
||||
}
|
||||
@ -185,11 +197,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// Trim out all unused nodes</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">used_nodes</span> <span class="op">=</span> <span class="ident">HashSet</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> <span class="ident">way</span> <span class="kw">in</span> <span class="ident">ways</span>.<span class="ident">values</span>() {
|
||||
<span class="ident">used_nodes</span>.<span class="ident">extend</span>(<span class="ident">way</span>.<span class="ident">nodes</span>().<span class="ident">into_iter</span>().<span class="ident">cloned</span>());
|
||||
}
|
||||
|
||||
<span class="comment">// TODO Buffer?</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">writer</span> <span class="op">=</span> <span class="ident">osmio</span>::<span class="ident">xml</span>::<span class="ident">XMLWriter</span>::<span class="ident">new</span>(<span class="ident">File</span>::<span class="ident">create</span>(<span class="string">"tmp.osm"</span>)<span class="question-mark">?</span>);
|
||||
<span class="comment">// TODO Nondetermistic output because of HashMap!</span>
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">node</span>) <span class="kw">in</span> <span class="ident">nodes</span> {
|
||||
<span class="ident">writer</span>.<span class="ident">write_obj</span>(<span class="kw-2">&</span><span class="ident">RcOSMObj</span>::<span class="ident">Node</span>(<span class="ident">node</span>))<span class="question-mark">?</span>;
|
||||
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="ident">used_nodes</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">node</span>) <span class="op">=</span> <span class="ident">nodes</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">id</span>) {
|
||||
<span class="ident">writer</span>.<span class="ident">write_obj</span>(<span class="kw-2">&</span><span class="ident">RcOSMObj</span>::<span class="ident">Node</span>(<span class="ident">node</span>))<span class="question-mark">?</span>;
|
||||
}
|
||||
}
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">way</span>) <span class="kw">in</span> <span class="ident">ways</span> {
|
||||
<span class="ident">writer</span>.<span class="ident">write_obj</span>(<span class="kw-2">&</span><span class="ident">RcOSMObj</span>::<span class="ident">Way</span>(<span class="ident">way</span>))<span class="question-mark">?</span>;
|
||||
|
@ -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.50.0 (cb75ad5db 2021-02-10)"</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">"Mon, 15 Mar 2021 18:07:17 +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">"Mon, 15 Mar 2021 18:18:23 +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>
|
||||
|
Loading…
Reference in New Issue
Block a user