-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate stop to subshape mapping during import #136
Calculate stop to subshape mapping during import #136
Conversation
This also adds files missing in last commit
Using a `shapes_storage` instance will now always calculate and store shapes and shape offsets.
include/nigiri/loader/gtfs/shape.h
Outdated
template <typename DoubleRange> | ||
requires std::ranges::range<DoubleRange> && | ||
std::is_same_v<std::ranges::range_value_t<DoubleRange>, double> | ||
inline bool valid_distances(DoubleRange distances) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline bool valid_distances(DoubleRange distances) { | |
bool valid_distances(DoubleRange distances) { |
Templates do not need inline
and usually the compiler does a better job at deciding what should be really inlined. So inline
is mostly a instruction to the linker, which is not needed in this case (as it's a template).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the reminder.
Due to some changes, the function has been removed entirely.
As values must increase, only leading `0.0`s are allowed.
Assume visual errors will not be noticed by end users. Therefore some optimization can be skipped.
Amazing job!! 🤩 🚀 🎉 |
This extends the shape support, implemented with #127.
Clients may now request the shape of a trip segment. These will be calculated during import, to reduce runtime costs. The corresponding mapping will be stored to a memory map.
As the calculation will take some time, especially for frequent trips using the same stops and shape, results will be cached during import.