diff --git a/Cargo.lock b/Cargo.lock index 316886e9..16857f89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "abstutil" version = "0.1.0" -source = "git+https://github.com/a-b-street/abstreet#520ef8f73e52d74056a181fb77cf286e0dd226e5" +source = "git+https://github.com/a-b-street/abstreet#817e2203fe16e6cc835f473f3e84ed9edaea73bb" dependencies = [ "anyhow", "bincode", @@ -13,7 +13,7 @@ dependencies = [ "env_logger", "fs-err", "instant", - "itertools", + "itertools 0.12.0", "log", "num_cpus", "scoped_threadpool", @@ -29,6 +29,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -38,11 +50,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -197,7 +215,7 @@ dependencies = [ [[package]] name = "country-geocoder" version = "0.1.0" -source = "git+https://github.com/a-b-street/country-geocoder#395e847748f1db955e96ecbdbad2fedea3ceeb74" +source = "git+https://github.com/a-b-street/country-geocoder#4a9b736340f7824f24f4e35cede1ffbceac2ec84" dependencies = [ "geo", "geojson", @@ -278,7 +296,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -289,16 +307,16 @@ checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.98", ] [[package]] name = "earcutr" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0812b44697951d35fde8fcb0da81c9de7e809e825a66bbf1ecb79d9829d4ca3d" +checksum = "79127ed59a85d7687c409e9978547cffb7dc79675355ed22da6b66fd5f6ead01" dependencies = [ - "itertools", + "itertools 0.11.0", "num-traits", ] @@ -335,7 +353,7 @@ checksum = "2a4da76b3b6116d758c7ba93f7ec6a35d2e2cf24feda76c6e38a375f4d5c59f2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -357,14 +375,14 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -386,12 +404,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -411,7 +429,7 @@ dependencies = [ "abstutil", "anyhow", "enum-map", - "itertools", + "itertools 0.11.0", "osm2streets", "petgraph", "serde", @@ -460,9 +478,9 @@ checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" [[package]] name = "geo" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1645cf1d7fea7dac1a66f7357f3df2677ada708b8d9db8e9b043878930095a96" +checksum = "4841b40fdbccd4b7042bd6195e4de91da54af34c50632e371bcbfcdfb558b873" dependencies = [ "earcutr", "float_next_after", @@ -472,13 +490,14 @@ dependencies = [ "num-traits", "robust", "rstar", + "spade", ] [[package]] name = "geo-types" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9705398c5c7b26132e74513f4ee7c1d7dafd786004991b375c172be2be0eecaa" +checksum = "567495020b114f1ce9bed679b29975aa0bfae06ac22beacd5cfde5dabe7b05d6" dependencies = [ "approx", "num-traits", @@ -511,7 +530,7 @@ dependencies = [ [[package]] name = "geom" version = "0.1.0" -source = "git+https://github.com/a-b-street/abstreet#520ef8f73e52d74056a181fb77cf286e0dd226e5" +source = "git+https://github.com/a-b-street/geom#9bb49fce2be2c527405a821ffd22c63869416976" dependencies = [ "anyhow", "earcutr", @@ -542,6 +561,16 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + [[package]] name = "heapless" version = "0.7.15" @@ -555,15 +584,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.0" @@ -604,7 +624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -635,7 +655,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" dependencies = [ - "hermit-abi 0.3.0", + "hermit-abi", "io-lifetimes", "rustix 0.36.8", "windows-sys 0.45.0", @@ -643,9 +663,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ "either", ] @@ -678,9 +707,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -693,9 +722,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" @@ -703,6 +732,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall", +] + [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -711,9 +751,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -727,12 +767,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" @@ -794,11 +831,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] @@ -816,9 +853,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "ordered-float" -version = "3.7.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" +checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" dependencies = [ "num-traits", "rand", @@ -832,6 +869,7 @@ dependencies = [ "abstutil", "anyhow", "enumset", + "env_logger", "geom", "serde", ] @@ -842,6 +880,8 @@ version = "0.1.0" dependencies = [ "abstutil", "console_error_panic_hook", + "console_log", + "log", "osm2lanes", "serde-wasm-bindgen", "serde_json", @@ -858,7 +898,7 @@ dependencies = [ "geo", "geojson", "geom", - "itertools", + "itertools 0.11.0", "log", "osm2lanes", "petgraph", @@ -883,12 +923,15 @@ dependencies = [ "abstutil", "anyhow", "console_error_panic_hook", + "console_log", "experimental", "geom", "instant", + "log", "osm2streets", "serde", "serde-wasm-bindgen", + "serde_json", "streets_reader", "wasm-bindgen", ] @@ -919,21 +962,20 @@ dependencies = [ [[package]] name = "polylabel" -version = "2.5.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61132847769c5a4f41a977fd56e58e7e7a3c8ca602008dd124c0928c7387bfcb" +checksum = "93b10c25671a60bbd95b230005a8fa1964d34ee4dbcd7306c36fac979b660fab" dependencies = [ "geo", - "libc", "num-traits", "thiserror", ] [[package]] name = "proc-macro2" -version = "1.0.41" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdcc2916cde080c1876ff40292a396541241fe0072ef928cd76582e9ea5d60d2" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -991,9 +1033,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.20" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1037,15 +1079,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -1057,12 +1090,9 @@ dependencies = [ [[package]] name = "redox_termios" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" -dependencies = [ - "redox_syscall 0.2.15", -] +checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb" [[package]] name = "regex" @@ -1153,15 +1183,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" dependencies = [ "bitflags 2.4.1", - "errno 0.3.5", + "errno 0.3.8", "libc", - "linux-raw-sys 0.4.10", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.12", + "windows-sys 0.52.0", ] [[package]] @@ -1214,9 +1244,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.140" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] @@ -1234,20 +1264,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1260,6 +1290,18 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +[[package]] +name = "spade" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d3bf265ec2d5dd1ddf87863252123447c550491adba2c70c574173a95cd8ba" +dependencies = [ + "hashbrown 0.14.3", + "num-traits", + "robust", + "smallvec", +] + [[package]] name = "spin" version = "0.9.4" @@ -1300,6 +1342,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tempfile" version = "3.8.1" @@ -1308,8 +1361,8 @@ checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", - "rustix 0.38.21", + "redox_syscall", + "rustix 0.38.26", "windows-sys 0.48.0", ] @@ -1324,13 +1377,13 @@ dependencies = [ [[package]] name = "termion" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659c1f379f3408c7e5e84c7d0da6d93404e3800b6b9d063ba24436419302ec90" +checksum = "c4648c7def6f2043b2568617b9f9b75eae88ca185dbc1f1fda30e95a85d49d7d" dependencies = [ "libc", + "libredox", "numtoa", - "redox_syscall 0.2.15", "redox_termios", ] @@ -1340,6 +1393,7 @@ version = "0.1.0" dependencies = [ "abstutil", "anyhow", + "env_logger", "experimental", "geom", "osm2streets", @@ -1365,7 +1419,7 @@ checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1380,6 +1434,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "void" version = "1.0.2" @@ -1408,9 +1468,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1418,24 +1478,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1443,28 +1503,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -1479,7 +1539,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.21", + "rustix 0.38.26", ] [[package]] @@ -1531,6 +1591,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.1" @@ -1561,6 +1630,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.1" @@ -1573,6 +1657,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.1" @@ -1585,6 +1675,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.1" @@ -1597,6 +1693,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.1" @@ -1609,6 +1711,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.1" @@ -1621,6 +1729,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.1" @@ -1633,6 +1747,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.1" @@ -1645,8 +1765,34 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "xmlparser" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] diff --git a/Cargo.toml b/Cargo.toml index 4037d7b7..2379fb35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,14 +10,17 @@ members = [ "tests", ] +resolver = "2" + # Specify the versions for common dependencies just once here, instead of # repeating in a bunch of crates [workspace.dependencies] anyhow = "1.0.38" -serde = "1.0.123" -serde_json = "1.0.61" +geom = { git = "https://github.com/a-b-street/geom" } +serde = "1.0.193" +serde_json = "1.0.108" # To temporarily work on dependencies locally, uncomment this #[patch."https://github.com/a-b-street/abstreet"] #abstutil = { path = "/home/dabreegster/abstreet/abstutil" } -#geom = { path = "/home/dabreegster/abstreet/geom" } +#geom = { path = "/home/dabreegster/geom" } diff --git a/README.md b/README.md index f1316e54..12a97568 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,6 @@ offline without running an external server). - [osm2streets-vector-tileserver](https://github.com/jakecoppinger/osm2streets-vector-tileserver): Dynamically generate vector tiles and view with QGIS, Mapbox, etc - [safe-cycling-map](https://github.com/jakecoppinger/safe-cycling-map) is an example Mapbox use - [lane editor](https://a-b-street.github.io/osm2streets/lane_editor.html) to edit OSM tags and see visual results -- [ATIP](https://github.com/acteng/atip): sketching active travel infrastructure, using `osm2streets` for contextual layers about speed and lane configuration - _Planned: plugins for [iD](https://github.com/openstreetmap/iD) and [JOSM](https://josm.openstreetmap.de/) to display streets in detail and visually edit lane tagging_ diff --git a/experimental/Cargo.toml b/experimental/Cargo.toml index 2bea8b86..909b81c5 100644 --- a/experimental/Cargo.toml +++ b/experimental/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -itertools = "0.10.2" +itertools = "0.11.0" petgraph = "0.6.3" # utilities from abstreet diff --git a/osm2lanes-js/Cargo.toml b/osm2lanes-js/Cargo.toml index 07b35cdc..720e95b7 100644 --- a/osm2lanes-js/Cargo.toml +++ b/osm2lanes-js/Cargo.toml @@ -12,6 +12,8 @@ crate-type = ["cdylib", "rlib"] [dependencies] abstutil = { git = "https://github.com/a-b-street/abstreet" } console_error_panic_hook = "0.1.6" +console_log = "1.0.0" +log = "0.4.20" osm2lanes = { path = "../osm2lanes" } wasm-bindgen = "0.2.84" serde_json = { workspace = true } diff --git a/osm2lanes-js/src/lib.rs b/osm2lanes-js/src/lib.rs index 4809e1e2..579bd626 100644 --- a/osm2lanes-js/src/lib.rs +++ b/osm2lanes-js/src/lib.rs @@ -1,11 +1,15 @@ +use std::sync::Once; + use wasm_bindgen::prelude::*; use abstutil::Tags; -use osm2lanes::{MapConfig, get_lane_specs_ltr}; +use osm2lanes::{get_lane_specs_ltr, MapConfig}; + +static SETUP_LOGGER: Once = Once::new(); #[wasm_bindgen(js_name = getLaneSpecs)] pub fn get_lane_specs(tags: JsValue, config: JsValue) -> Result { - abstutil::logger::setup(); + SETUP_LOGGER.call_once(|| console_log::init_with_level(log::Level::Info).unwrap()); // Panics shouldn't happen, but if they do, console.log them. console_error_panic_hook::set_once(); diff --git a/osm2lanes/Cargo.toml b/osm2lanes/Cargo.toml index 61b86040..90b292c9 100644 --- a/osm2lanes/Cargo.toml +++ b/osm2lanes/Cargo.toml @@ -7,5 +7,8 @@ edition = "2021" abstutil = { git = "https://github.com/a-b-street/abstreet" } anyhow = { workspace = true } enumset = { version = "1.0.12", features=["serde"] } -geom = { git = "https://github.com/a-b-street/abstreet" } +geom = { workspace = true } serde = { workspace = true } + +[dev-dependencies] +env_logger = "0.10.1" diff --git a/osm2lanes/src/tests.rs b/osm2lanes/src/tests.rs index 324c647c..ea5a374c 100644 --- a/osm2lanes/src/tests.rs +++ b/osm2lanes/src/tests.rs @@ -1,10 +1,15 @@ +use std::sync::Once; + use abstutil::Tags; +use env_logger::{Builder, Env}; use crate::{get_lane_specs_ltr, Direction, DrivingSide, MapConfig}; +static SETUP_LOGGER: Once = Once::new(); + #[test] fn test_osm_to_specs() { - abstutil::logger::setup(); + SETUP_LOGGER.call_once(|| Builder::from_env(Env::default().default_filter_or("info")).init()); let mut ok = true; for (url, mut input, driving_side, expected_lt, expected_dir) in vec![ diff --git a/osm2streets-js/Cargo.toml b/osm2streets-js/Cargo.toml index ab2b7b28..dc93e29d 100644 --- a/osm2streets-js/Cargo.toml +++ b/osm2streets-js/Cargo.toml @@ -13,12 +13,15 @@ crate-type = ["cdylib", "rlib"] abstutil = { git = "https://github.com/a-b-street/abstreet" } anyhow = { workspace = true } console_error_panic_hook = "0.1.6" -geom = { git = "https://github.com/a-b-street/abstreet" } +console_log = "1.0.0" +geom = { workspace = true } experimental = { path = "../experimental" } # TODO Upstream this in abstutil crate. WASM is missing some runtime dep otherwise. instant = { version = "0.1.12", features = ["wasm-bindgen"] } +log = "0.4.20" osm2streets = { path = "../osm2streets" } serde = { workspace = true } +serde_json = { workspace = true } streets_reader = { path = "../streets_reader" } wasm-bindgen = "0.2.84" serde-wasm-bindgen = "0.5.0" diff --git a/osm2streets-js/src/lib.rs b/osm2streets-js/src/lib.rs index 8f51b9d3..45409964 100644 --- a/osm2streets-js/src/lib.rs +++ b/osm2streets-js/src/lib.rs @@ -1,4 +1,5 @@ use std::collections::{BTreeMap, BTreeSet}; +use std::sync::Once; use abstutil::{Tags, Timer}; use geom::{Distance, LonLat, Polygon, PolyLine}; @@ -10,6 +11,8 @@ use osm2streets::{ StreetNetwork, Transformation, }; +static SETUP_LOGGER: Once = Once::new(); + #[derive(Serialize, Deserialize)] pub struct ImportOptions { debug_each_step: bool, @@ -33,7 +36,7 @@ impl JsStreetNetwork { clip_pts_geojson: &str, input: JsValue, ) -> Result { - abstutil::logger::setup(); + SETUP_LOGGER.call_once(|| console_log::init_with_level(log::Level::Info).unwrap()); // Panics shouldn't happen, but if they do, console.log them. console_error_panic_hook::set_once(); @@ -157,21 +160,21 @@ impl JsStreetNetwork { .to_geojson(Some(&self.inner.gps_bounds)), ); } - abstutil::to_json(&geom::geometries_to_geojson(polygons)) + serde_json::to_string_pretty(&geom::geometries_to_geojson(polygons)).unwrap() } // TODO I think https://github.com/cloudflare/serde-wasm-bindgen would let us just return a // HashMap #[wasm_bindgen(js_name = getOsmTagsForWay)] pub fn get_osm_tags_for_way(&self, id: i64) -> String { - abstutil::to_json(&self.ways[&osm::WayID(id)].tags) + serde_json::to_string_pretty(&self.ways[&osm::WayID(id)].tags).unwrap() } /// Returns the entire StreetNetwork as JSON. The API doesn't have guarantees about backwards /// compatibility. #[wasm_bindgen(js_name = toJson)] pub fn to_json(&self) -> String { - abstutil::to_json(&self.inner) + serde_json::to_string_pretty(&self.inner).unwrap() } /// Returns a GeoJSON Polygon showing a wide buffer around the way's original geometry @@ -217,7 +220,7 @@ impl JsStreetNetwork { .iter() .for_each(|c| polygon = polygon.difference(c).unwrap()[0].clone()); - abstutil::to_json(&polygon.to_geojson(Some(&self.inner.gps_bounds))) + serde_json::to_string_pretty(&polygon.to_geojson(Some(&self.inner.gps_bounds))).unwrap() } /// Returns the XML string representing a way. Any OSM tags changed via @@ -250,7 +253,7 @@ impl JsStreetNetwork { #[wasm_bindgen(js_name = overwriteOsmTagsForWay)] pub fn overwrite_osm_tags_for_way(&mut self, id: i64, tags: String) { let id = osm::WayID(id); - let tags: Tags = abstutil::from_json(tags.as_bytes()).unwrap(); + let tags: Tags = serde_json::from_slice(tags.as_bytes()).unwrap(); let mut intersections = BTreeSet::new(); for road in self.inner.roads.values_mut() { diff --git a/osm2streets/Cargo.toml b/osm2streets/Cargo.toml index 41e11576..3e79676c 100644 --- a/osm2streets/Cargo.toml +++ b/osm2streets/Cargo.toml @@ -9,10 +9,10 @@ rust-version = "1.66" abstutil = { git = "https://github.com/a-b-street/abstreet" } anyhow = { workspace = true } enumset = { version = "1.0.12", features=["serde"] } -geo = "0.26.0" +geo = "0.27.0" geojson = "0.24.1" -geom = { git = "https://github.com/a-b-street/abstreet" } -itertools = "0.10.5" +geom = { workspace = true } +itertools = "0.11.0" log = "0.4.14" osm2lanes = { path = "../osm2lanes" } petgraph = { version = "0.6.3" } diff --git a/osm2streets/src/ids.rs b/osm2streets/src/ids.rs index 16f301f9..ff266841 100644 --- a/osm2streets/src/ids.rs +++ b/osm2streets/src/ids.rs @@ -1,8 +1,8 @@ use std::fmt; -use abstutil::{deserialize_usize, serialize_usize}; use serde::{Deserialize, Serialize}; +use crate::utils::{deserialize_usize, serialize_usize}; use crate::Road; /// Opaque and non-contiguous diff --git a/osm2streets/src/intersection.rs b/osm2streets/src/intersection.rs index 8113d0f5..80b3d982 100644 --- a/osm2streets/src/intersection.rs +++ b/osm2streets/src/intersection.rs @@ -1,11 +1,11 @@ use std::collections::BTreeMap; -use abstutil::{deserialize_btreemap, serialize_btreemap}; use geom::{Circle, Distance, Polygon, Pt2D}; use serde::{Deserialize, Serialize}; use osm2lanes::osm; +use crate::utils::{deserialize_btreemap, serialize_btreemap}; use crate::{DrivingSide, IntersectionID, RoadID, StreetNetwork}; use TrafficConflict::*; diff --git a/osm2streets/src/lib.rs b/osm2streets/src/lib.rs index 26362c45..2604fdfa 100644 --- a/osm2streets/src/lib.rs +++ b/osm2streets/src/lib.rs @@ -7,9 +7,10 @@ use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; -use abstutil::{deserialize_btreemap, serialize_btreemap}; use geom::{GPSBounds, PolyLine, Polygon, Pt2D}; +use self::utils::{deserialize_btreemap, serialize_btreemap}; + pub use self::geometry::{intersection_polygon, InputRoad}; pub(crate) use self::ids::RoadWithEndpoints; pub use self::ids::{CommonEndpoint, IntersectionID, LaneID, RoadID}; @@ -40,6 +41,7 @@ mod render; mod road; mod transform; mod types; +pub mod utils; mod validate; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/osm2streets/src/types.rs b/osm2streets/src/types.rs index 13539320..83a4f014 100644 --- a/osm2streets/src/types.rs +++ b/osm2streets/src/types.rs @@ -2,7 +2,9 @@ use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; -use abstutil::{deserialize_btreemap, serialize_btreemap, Tags}; +use abstutil::Tags; + +use crate::utils::{deserialize_btreemap, serialize_btreemap}; /// None corresponds to the native name #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] diff --git a/osm2streets/src/utils.rs b/osm2streets/src/utils.rs new file mode 100644 index 00000000..7bd49fb9 --- /dev/null +++ b/osm2streets/src/utils.rs @@ -0,0 +1,64 @@ +// Copied from https://github.com/a-b-street/abstreet/tree/main/abstutil/src to reduce dependencies + +use std::collections::BTreeMap; + +use anyhow::Result; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +/// Format a number with commas +pub fn prettyprint_usize(x: usize) -> String { + let num = format!("{}", x); + let mut result = String::new(); + let mut i = num.len(); + for c in num.chars() { + result.push(c); + i -= 1; + if i > 0 && i % 3 == 0 { + result.push(','); + } + } + result +} + +/// Serializes a `usize` as a `u32` to save space. Useful when you need `usize` for indexing, but +/// the values don't exceed 2^32. +pub fn serialize_usize(x: &usize, s: S) -> Result { + if let Ok(x) = u32::try_from(*x) { + x.serialize(s) + } else { + Err(serde::ser::Error::custom(format!("{} can't fit in u32", x))) + } +} + +/// Deserializes a `usize` from a `u32`. +pub fn deserialize_usize<'de, D: Deserializer<'de>>(d: D) -> Result { + let x = ::deserialize(d)?; + Ok(x as usize) +} + +/// Serializes a BTreeMap as a list of tuples. Necessary when the keys are structs; see +/// https://github.com/serde-rs/json/issues/402. +pub fn serialize_btreemap( + map: &BTreeMap, + s: S, +) -> Result { + map.iter().collect::>().serialize(s) +} + +/// Deserializes a BTreeMap from a list of tuples. Necessary when the keys are structs; see +/// https://github.com/serde-rs/json/issues/402. +pub fn deserialize_btreemap< + 'de, + D: Deserializer<'de>, + K: Deserialize<'de> + Ord, + V: Deserialize<'de>, +>( + d: D, +) -> Result, D::Error> { + let vec = >::deserialize(d)?; + let mut map = BTreeMap::new(); + for (k, v) in vec { + map.insert(k, v); + } + Ok(map) +} diff --git a/streets_reader/Cargo.toml b/streets_reader/Cargo.toml index 83de9a19..ce112c4f 100644 --- a/streets_reader/Cargo.toml +++ b/streets_reader/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" abstutil = { git = "https://github.com/a-b-street/abstreet" } anyhow = { workspace = true } country-geocoder = { git = "https://github.com/a-b-street/country-geocoder" } -geom = { git = "https://github.com/a-b-street/abstreet" } +geom = { workspace = true } log = "0.4.14" osm2streets = { path = "../osm2streets" } osmpbf = "0.3.2" diff --git a/streets_reader/src/osm_reader/reader.rs b/streets_reader/src/osm_reader/reader.rs index eb7d0986..4323e496 100644 --- a/streets_reader/src/osm_reader/reader.rs +++ b/streets_reader/src/osm_reader/reader.rs @@ -2,13 +2,14 @@ use std::collections::{BTreeMap, HashMap}; use std::io::Cursor; use std::iter::Peekable; -use abstutil::{prettyprint_usize, Tags, Timer}; +use abstutil::{Tags, Timer}; use anyhow::Result; use geom::{GPSBounds, LonLat}; use osmpbf::{BlobDecode, BlobReader, Element as PbfElement, IndexedReader, RelMemberType}; use xmlparser::Token; use osm2streets::osm::{NodeID, OsmID, RelationID, WayID}; +use osm2streets::utils::prettyprint_usize; use super::{Document, Node, Relation, Way}; diff --git a/streets_reader/src/split_ways.rs b/streets_reader/src/split_ways.rs index 00686082..5906c579 100644 --- a/streets_reader/src/split_ways.rs +++ b/streets_reader/src/split_ways.rs @@ -1,6 +1,6 @@ use std::collections::{hash_map::Entry, HashMap}; -use abstutil::{Counter, Timer}; +use abstutil::Timer; use geom::{HashablePt2D, PolyLine, Pt2D}; use osm2streets::{ Direction, IntersectionControl, IntersectionID, IntersectionKind, Road, RoadID, StreetNetwork, @@ -23,14 +23,16 @@ pub fn split_up_roads( // Create intersections for any points shared by at least 2 roads, and for endpoints of every // road. - let mut counts_per_pt = Counter::new(); + let mut count_per_pt = HashMap::new(); let mut pt_to_intersection_id: HashMap = HashMap::new(); timer.start_iter("look for common points", input.roads.len()); for (_, pts, _) in &input.roads { timer.next(); for (idx, pt) in pts.iter().enumerate() { let hash_pt = pt.to_hashable(); - let count = counts_per_pt.inc(hash_pt); + let entry = count_per_pt.entry(hash_pt).or_insert(0); + *entry += 1; + let count = *entry; if count == 2 || idx == 0 || idx == pts.len() - 1 { if let Entry::Vacant(entry) = pt_to_intersection_id.entry(hash_pt) { diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 262d2042..792cdfae 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -6,7 +6,8 @@ edition = "2021" [dependencies] abstutil = { git = "https://github.com/a-b-street/abstreet" } anyhow = { workspace = true } -geom = { git = "https://github.com/a-b-street/abstreet" } +env_logger = "0.10.1" +geom = { workspace = true } streets_reader = { path = "../streets_reader" } serde = { workspace = true } serde_json = { workspace = true } diff --git a/tests/src/lib.rs b/tests/src/lib.rs index e3b73495..3c2b10c5 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -2,17 +2,24 @@ mod tests { use std::path::Path; - use abstutil::Timer; + use std::sync::Once; + use anyhow::{bail, Result}; use geom::LonLat; + use env_logger::{Builder, Env}; + + use abstutil::Timer; use experimental::RoadNetwork; use osm2streets::{MapConfig, Transformation}; + static SETUP_LOGGER: Once = Once::new(); + include!(concat!(env!("OUT_DIR"), "/tests.rs")); fn test(path: &str) -> Result<()> { - abstutil::logger::setup(); + SETUP_LOGGER + .call_once(|| Builder::from_env(Env::default().default_filter_or("info")).init()); let mut timer = Timer::new("test osm2streets");