Skip to content

Commit f831da9

Browse files
make route_shapes require with_shapes + street_routing
1 parent eb5629b commit f831da9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/config.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ void config::verify() const {
123123
nigiri::routing::kMaxSearchIntervalSize.count());
124124

125125
if (timetable_) {
126+
utl::verify(!timetable_->route_shapes_.has_value() ||
127+
(timetable_->with_shapes_ && street_routing),
128+
"feature ROUTE_SHAPES requires SHAPES and STREET_ROUTING");
129+
126130
for (auto const& [id, d] : timetable_->datasets_) {
127131
utl::verify(!id.contains("_"), "dataset identifier may not contain '_'");
128132
if (d.rt_.has_value()) {

src/import.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ data import(config const& c, fs::path const& data_path, bool const write) {
236236
auto const shape_cache_lock_path =
237237
fs::path{shape_cache_path.generic_string() + "-lock"};
238238
auto const route_shapes_task_enabled =
239-
c.timetable_ && c.timetable_->with_shapes_ &&
240-
c.timetable_->route_shapes_ && c.use_street_routing();
239+
c.timetable_
240+
.transform([](auto&& x) { return x.route_shapes_.has_value(); })
241+
.value_or(false);
241242
auto const existing_rs_hashes = read_hashes(data_path, "route_shapes");
242243
auto const route_shapes_reuse_old_osm_data =
243244
c.timetable_.value_or(config::timetable{})

0 commit comments

Comments
 (0)