Skip to content

Commit

Permalink
fix api: duration in seconds, place types
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Nov 7, 2024
1 parent 5c016d1 commit dbf34c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/journey_to_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::chrono::seconds>(
j_leg.arr_time_ - j_leg.dep_time_)
.count(),
.startTime_ = j_leg.dep_time_,
.endTime_ = j_leg.arr_time_,
.scheduledStartTime_ =
Expand All @@ -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_;

Expand Down
2 changes: 1 addition & 1 deletion src/place.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dbf34c5

Please sign in to comment.