Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Oct 27, 2024
1 parent a04a8a7 commit 9c64747
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[osr]
[email protected]:motis-project/osr.git
branch=master
commit=2c9bf3d6b1af66fdeccfd2c7997024b36b5b0dee
commit=ab16a3e91a2297e76b71420b44eff227a944d26e
[utl]
[email protected]:motis-project/utl.git
branch=master
Expand Down
4 changes: 2 additions & 2 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
17090545778340763548
16363485000064493220
cista 9ce6fefd2f0dc3f591eca727594c45cec2e46e3b
zlib-ng 68ab3e2d80253ec5dc3c83691d9ff70477b32cd3
boost 73549ebca677fe6214202a1ab580362b4f80e653
Expand Down Expand Up @@ -39,7 +39,7 @@ sol2 3427b4412516c776226a751c13bfb95bb57bc61a
variant 5aa73631dc969087c77433a5cdef246303051f69
tiles a7bc84e9e7919afa0fbb6b5def762c706e5a0880
rtree.c 6ed73a7dc4f1184f2b5b2acd8ac1c2b28a273057
osr 2c9bf3d6b1af66fdeccfd2c7997024b36b5b0dee
osr ab16a3e91a2297e76b71420b44eff227a944d26e
yaml-cpp 1d8ca1f35eb3a9c9142462b28282a848e5d29a91
reflect-cpp c54fe66de4650b60c23aadd4a06d9db4ffeda22f
FTXUI dd6a5d371fd7a3e2937bb579955003c54b727233
Expand Down
2 changes: 0 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,6 @@ components:
StepInstruction:
type: object
required:
- fromLevel
- toLevel
- polyline
- relativeDirection
- absoluteDirection
Expand Down
10 changes: 8 additions & 2 deletions src/journey_to_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,14 @@ api::Itinerary journey_to_response(osr::ways const* w,
.relativeDirection_ = api::RelativeDirectionEnum::CONTINUE, // TODO
.absoluteDirection_ = api::AbsoluteDirectionEnum::NORTH, // TODO
.distance_ = static_cast<double>(s.dist_),
.fromLevel_ = to_float(s.from_level_),
.toLevel_ = to_float(s.to_level_),
.fromLevel_ =
s.from_level_ == osr::kNoLevel
? std::nullopt
: std::optional{static_cast<double>(to_float(s.from_level_))},
.toLevel_ =
s.to_level_ == osr::kNoLevel
? std::nullopt
: std::optional{static_cast<double>(to_float(s.to_level_))},
.osmWay_ = s.way_ == osr::way_idx_t ::invalid()
? std::nullopt
: std::optional{static_cast<std::int64_t>(
Expand Down
48 changes: 26 additions & 22 deletions test/routing_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,32 +312,36 @@ TEST(motis, routing) {
auto ec = std::error_code{};
std::filesystem::remove_all("test/data", ec);

(void)kFastaJson;
auto d = import(
config{.osm_ = {"test/resources/test_case.osm.pbf"},
.timetable_ =
config::timetable{
.first_day_ = "2019-05-01",
.num_days_ = 2,
.datasets_ = {{"test", {.path_ = std::string{kGTFS}}}}},
config{.server_ = {{.web_folder_ = "ui/build"}},
.osm_ = {"test/resources/test_case.osm.pbf"},
.tiles_ = {{.profile_ = "deps/tiles/profile/full.lua"}},
.timetable_ = {{.first_day_ = "2019-05-01",
.num_days_ = 2,
.datasets_ = {{"test",
{.path_ = std::string{kGTFS}}}}}},
.street_routing_ = true,
.osr_footpath_ = true},
"test/data", false);
.osr_footpath_ = true,
.geocoding_ = true,
.reverse_geocoding_ = true},
"test/data", true);
d.rt_->e_ = std::make_unique<elevators>(*d.w_, *d.elevator_nodes_,
parse_fasta(kFastaJson));
d.init_rtt(date::sys_days{2019_y / May / 1});
auto const stats = n::rt::gtfsrt_update_msg(
*d.tt_, *d.rt_->rtt_, n::source_idx_t{0}, "test",
to_feed_msg(
{trip_update{.trip_id_ = "ICE",
.start_time_ = {"03:35:00"},
.date_ = {"20190501"},
.stop_updates_ = {{.stop_id_ = "FFM_12",
.seq_ = std::optional{1U},
.ev_type_ = n::event_type::kArr,
.delay_minutes_ = 10,
.stop_assignment_ = "FFM_12"}}}},
date::sys_days{2019_y / May / 1} + 9h));
EXPECT_EQ(1U, stats.total_entities_success_);
// d.init_rtt(date::sys_days{2019_y / May / 1});
// auto const stats = n::rt::gtfsrt_update_msg(
// *d.tt_, *d.rt_->rtt_, n::source_idx_t{0}, "test",
// to_feed_msg(
// {trip_update{.trip_id_ = "ICE",
// .start_time_ = {"03:35:00"},
// .date_ = {"20190501"},
// .stop_updates_ = {{.stop_id_ = "FFM_12",
// .seq_ = std::optional{1U},
// .ev_type_ = n::event_type::kArr,
// .delay_minutes_ = 10,
// .stop_assignment_ = "FFM_12"}}}},
// date::sys_days{2019_y / May / 1} + 9h));
// EXPECT_EQ(1U, stats.total_entities_success_);

auto const routing = utl::init_from<ep::routing>(d).value();
EXPECT_EQ(d.rt_->rtt_.get(), routing.rt_->rtt_.get());
Expand Down
2 changes: 1 addition & 1 deletion ui/src/routes/ItineraryGeoJSON.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
properties: {
color,
outlineColor,
level: p.fromLevel,
level: p.fromLevel ?? 0,
way: p.osmWay
},
geometry: {
Expand Down

0 comments on commit 9c64747

Please sign in to comment.