Skip to content

Commit

Permalink
sync before connect_ways to enable debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Nov 1, 2024
1 parent 03de6b4 commit 54f21fe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/osr/ways.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ struct ways {
return cista::mmap{(p_ / file).generic_string().c_str(), mode_};
}

void sync();

way_idx_t::value_t n_ways() const { return way_osm_idx_.size(); }
node_idx_t::value_t n_nodes() const { return node_to_osm_.size(); }

Expand Down
3 changes: 3 additions & 0 deletions src/extract.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ void extract(bool const with_platforms,
reader.close();
}

w.r_->write(out);
w.sync();

w.connect_ways();

auto r = std::vector<resolved_restriction>{};
Expand Down
12 changes: 12 additions & 0 deletions src/ways.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ void ways::connect_ways() {
std::filesystem::remove(p_ / "tmp_node_in_way_idx_index.bin", e);
}

void ways::sync() {
node_to_osm_.mmap_.sync();
way_osm_idx_.mmap_.sync();
way_polylines_.data_.mmap_.sync();
way_polylines_.bucket_starts_.mmap_.sync();
way_osm_nodes_.data_.mmap_.sync();
way_osm_nodes_.bucket_starts_.mmap_.sync();
strings_.data_.mmap_.sync();
strings_.bucket_starts_.mmap_.sync();
way_names_.mmap_.sync();
}

cista::wrapped<ways::routing> ways::routing::read(
std::filesystem::path const& p) {
return cista::read<ways::routing>(p / "routing.bin");
Expand Down

0 comments on commit 54f21fe

Please sign in to comment.