Skip to content

Commit

Permalink
osr: use memory mapped rtree
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Nov 4, 2024
1 parent 252f1e8 commit bc1d5db
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
[cista]
[email protected]:felixguendling/cista.git
branch=master
commit=5b6808fd7d7a7c1c7e4cb152b563dbf71e3efba4
commit=e64e312b6bec577a38268ed1479a3b990b8cbe72
[osr]
[email protected]:motis-project/osr.git
branch=master
commit=06ddcbb6ca05a9636373f015c2c852a11874bc79
commit=f0a180848d67b48c6442b87ee76f4cf2a0b3015d
[utl]
[email protected]:motis-project/utl.git
branch=master
Expand Down
6 changes: 3 additions & 3 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
16948827567758484956
cista 52577def055e4bdf90eaa461872fc1f7b5b1131d
1487178945974552552
cista e64e312b6bec577a38268ed1479a3b990b8cbe72
zlib-ng 68ab3e2d80253ec5dc3c83691d9ff70477b32cd3
boost 73549ebca677fe6214202a1ab580362b4f80e653
googletest 7b64fca6ea0833628d6f86255a81424365f7cc0c
Expand Down Expand Up @@ -39,7 +39,7 @@ sol2 40c7cbc7c5cfed1e8c7f1bbe6fcbe23d7a67fc75
variant 5aa73631dc969087c77433a5cdef246303051f69
tiles 6b6dc45bc904966640c7207ab91950848a8b3f6c
rtree.c 6ed73a7dc4f1184f2b5b2acd8ac1c2b28a273057
osr 06ddcbb6ca05a9636373f015c2c852a11874bc79
osr f0a180848d67b48c6442b87ee76f4cf2a0b3015d
yaml-cpp 1d8ca1f35eb3a9c9142462b28282a848e5d29a91
reflect-cpp c54fe66de4650b60c23aadd4a06d9db4ffeda22f
FTXUI dd6a5d371fd7a3e2937bb579955003c54b727233
Expand Down
2 changes: 1 addition & 1 deletion include/motis/hashes.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ constexpr auto const tiles_version = []() {
return meta_entry_t{"tiles_bin_ver", 1U};
};
constexpr auto const osr_footpath_version = []() {
return meta_entry_t{"osr_footpath_bin_ver", 1U};
return meta_entry_t{"osr_footpath_bin_ver", 2U};
};

std::string to_str(meta_t const&);
Expand Down
3 changes: 2 additions & 1 deletion src/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ data& data::operator=(data&&) = default;
void data::load_osr() {
auto const osr_path = path_ / "osr";
w_ = std::make_unique<osr::ways>(osr_path, cista::mmap::protection::READ);
l_ = std::make_unique<osr::lookup>(*w_);
l_ = std::make_unique<osr::lookup>(*w_, osr_path,
cista::mmap::protection::READ);
elevator_nodes_ =
std::make_unique<hash_set<osr::node_idx_t>>(get_elevator_nodes(*w_));
pl_ =
Expand Down
13 changes: 11 additions & 2 deletions src/import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,24 @@ data import(config const& c, fs::path const& data_path, bool const write) {
r.build_rtree(*d.t_);
r.write();
}
d.t_.get()->~typeahead();
d.t_.reset();
if (c.geocoding_) {
d.load_geocoder();
}
if (c.reverse_geocoding_) {
d.load_reverse_geocoder();
}
},
[&]() {
d.t_.reset();
d.r_.reset();
if (c.geocoding_) {
d.load_geocoder();
}
if (c.reverse_geocoding_) {
d.load_reverse_geocoder();
}
},
[&]() { d.load_geocoder(); },
{tt_hash,
osm_hash,
adr_version(),
Expand Down

0 comments on commit bc1d5db

Please sign in to comment.