From dbf34c588c259a31950df2fc0a5c7422e5f4c464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Thu, 7 Nov 2024 15:46:25 +0100 Subject: [PATCH] fix api: duration in seconds, place types --- src/journey_to_response.cc | 6 +++++- src/place.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/journey_to_response.cc b/src/journey_to_response.cc index ca58e4777..c57916609 100644 --- a/src/journey_to_response.cc +++ b/src/journey_to_response.cc @@ -104,7 +104,9 @@ api::Itinerary journey_to_response(osr::ways const* w, .mode_ = to_mode(enter_stop.get_clasz()), .from_ = to_place(tt_location{enter_stop}), .to_ = to_place(tt_location{exit_stop}), - .duration_ = (j_leg.arr_time_ - j_leg.dep_time_).count(), + .duration_ = std::chrono::duration_cast( + j_leg.arr_time_ - j_leg.dep_time_) + .count(), .startTime_ = j_leg.dep_time_, .endTime_ = j_leg.arr_time_, .scheduledStartTime_ = @@ -122,8 +124,10 @@ api::Itinerary journey_to_response(osr::ways const* w, .routeShortName_ = {std::string{ enter_stop.trip_display_name()}}, .source_ = fmt::to_string(fr.dbg())}); + leg.from_.vertexType_ = api::VertexTypeEnum::TRANSIT; leg.from_.departure_ = leg.startTime_; leg.from_.scheduledDeparture_ = leg.scheduledStartTime_; + leg.to_.vertexType_ = api::VertexTypeEnum::TRANSIT; leg.to_.arrival_ = leg.endTime_; leg.to_.scheduledArrival_ = leg.scheduledEndTime_; diff --git a/src/place.cc b/src/place.cc index 3ed1f1685..922335e5a 100644 --- a/src/place.cc +++ b/src/place.cc @@ -124,7 +124,7 @@ api::Place to_place(n::timetable const* tt, .level_ = get_level(w, pl, matches, l), .scheduledTrack_ = get_track(tt_l.scheduled_), .track_ = get_track(tt_l.l_), - .vertexType_ = api::VertexTypeEnum::NORMAL}; + .vertexType_ = api::VertexTypeEnum::TRANSIT}; } }}, l);