Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a193531
Refactor: Reconstruct bitfield map from timetable
Jonas-July Sep 3, 2025
352bcf3
Refactor: Use reconstructed bitfield map from timetable
Jonas-July Sep 3, 2025
9ab836c
feat: Write out intermediate timetables
Jonas-July Sep 3, 2025
08bbc91
feat: Write out shapes after each load step
Jonas-July Sep 8, 2025
cfe7583
feat: Add change detector for loading
Jonas-July Sep 3, 2025
5e3d17a
fix(stringstore.h): Return reference after assignment
Jonas-July Sep 4, 2025
3e403d4
feat: Use cached timetables to improve import time
Jonas-July Sep 4, 2025
7af254b
refactor: DRY shape merge
Jonas-July Sep 5, 2025
262c7d0
fix: Account for non-empty shapes_storage
Jonas-July Sep 5, 2025
4f475d2
feat(bitfields_): Use empty bitfields and merge later
Jonas-July Sep 5, 2025
6e4da14
feat(src_end_date_): Use empty src_end_date_ and merge later
Jonas-July Sep 5, 2025
95df472
refactor(source_file_names_/trip_debug_): Use empty and merge later
Jonas-July Sep 8, 2025
4f7eb2a
refactor(languages_): Use empty and merge later
Jonas-July Sep 8, 2025
2f78c9e
refactor(location_idx_t): Use empty and merge later
Jonas-July Sep 10, 2025
23a04a4
debug: Add progress tracker status Merging
Jonas-July Sep 10, 2025
41f2043
add assertions for location_idx_t
Jonas-July Sep 11, 2025
e5ae9a2
refactor(flex/write-once): Use empty and merge later
Jonas-July Sep 11, 2025
e958fb7
refactor(flex_area_idx_t): Use empty and merge later
Jonas-July Sep 12, 2025
60c933e
refactor(flex_area_rtree): Use empty and merge later
Jonas-July Sep 12, 2025
cdb256c
refactor(location_group_idx_t): Use empty and merge later
Jonas-July Sep 12, 2025
e873d56
refactor(flex_stop_seq_idx_t): Use empty and merge later
Jonas-July Sep 12, 2025
aa558f4
refactor(booking_rule_idx_t): Use empty and merge later
Jonas-July Sep 12, 2025
f52887e
refactor(flex_transport_traffic_days): Use empty and merge later
Jonas-July Sep 12, 2025
11c2123
refactor(trip_id_idx_t): Use empty and merge later
Jonas-July Sep 15, 2025
5f40781
refactor(trip_idx_t/append-only): Use empty and merge later
Jonas-July Sep 16, 2025
5e67750
refactor(route_idx_t/append-only): Use empty and merge later
Jonas-July Sep 17, 2025
067debd
refactor(trip_idx_t/route_idx_t): Use empty and merge later
Jonas-July Sep 17, 2025
c61a481
refactor(route_id_idx_t): Use empty and merge later
Jonas-July Sep 17, 2025
6e1a3c0
refactor(transport_idx_t/append-only): Use empty and merge later
Jonas-July Sep 18, 2025
ae7fdc2
refactor(transport_idx_t): Use empty and merge later
Jonas-July Sep 18, 2025
7188fda
refactor(trip_line_idx_t): Use empty and merge later
Jonas-July Sep 18, 2025
9b15179
refactor(area_idx_t): Use empty and merge later
Jonas-July Sep 19, 2025
d5e8ee3
refactor(provider_idx_t): Use empty and merge later
Jonas-July Sep 19, 2025
0f895da
refactor(attribute_idx_t): Use empty and merge later
Jonas-July Sep 19, 2025
ab1c5b4
refactor(trip_direction_string_idx_t): Use empty and merge later
Jonas-July Sep 19, 2025
4cef868
refactor(fares_): Use empty and merge later
Jonas-July Sep 19, 2025
117833b
refactor(profiles_/date_range_): No merging necessary
Jonas-July Sep 19, 2025
be47e0e
refactor(merged_trips_): Use empty and merge later
Jonas-July Sep 19, 2025
691f090
refactor(string_idx_t): Use empty and merge later
Jonas-July Sep 19, 2025
bdc7c65
refactor(source_idx_t): Use empty and merge later
Jonas-July Sep 21, 2025
a749b16
refactor(n_sources_): Init and merge
Jonas-July Nov 24, 2025
3106ca9
refactor: Use new timetable instead of clearing
Jonas-July Sep 22, 2025
855a46e
feat: Write out intermediate results of loading timetables
Jonas-July Sep 22, 2025
29840b4
refactor: Move source loading into separate function
Jonas-July Sep 23, 2025
5c71902
refactor: Move new timetable into its own variable
Jonas-July Sep 23, 2025
e244eda
refactor: Remove restoration of loaded data as it doesn't get cleared
Jonas-July Sep 23, 2025
b715b9a
refactor: Don't store old data as the timetable isn't changed
Jonas-July Sep 23, 2025
1855b50
refactor: Group bitfield index calculation together
Jonas-July Sep 23, 2025
eedd77a
refactor(source_file_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
0a57f04
refactor(language_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
3aaa37c
refactor(location_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
2377953
refactor(location_group_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
8da74d0
refactor(alt_name_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
eeb2f78
refactor(timezone_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
49f4c66
refactor(trip_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
d5c03f0
refactor(route_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
2428f31
refactor(source_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
0c3e819
refactor(area_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
f14b18b
refactor(transport_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
da2bf0d
refactor(provider_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
0888240
refactor(flex_transport_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
bcc2f60
refactor(flex_stop_seq_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
9e5e62b
refactor(booking_rule_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
01e5b90
refactor(trip_id_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
f05618f
refactor(merged_trips_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
1c12c90
refactor(trip_line_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
3813c3c
refactor(attribute_idx_t): Map via index mapping
Jonas-July Sep 23, 2025
ebd1ccb
refactor(load.cc): Group mappings
Jonas-July Sep 24, 2025
d30ae27
refactor(string_idx_t): Map via index mapping
Jonas-July Sep 25, 2025
d3c2747
refactor(bitfield_idx_t): Map via index mapping
Jonas-July Sep 25, 2025
6402cb3
refactor: Move merge logic into timetable.cc
Jonas-July Oct 15, 2025
d34b01a
feat(load.cc): Split merging from timetable loading
Jonas-July Nov 4, 2025
826a696
fix: explicitly use cista::to_idx and other import fixes
Jonas-July Nov 4, 2025
00fcb2d
feat(load.cc): Find all necessary recomputations
Jonas-July Nov 4, 2025
c591d4c
feat: Reuse cached timetable instead of loading from source
Jonas-July Nov 5, 2025
548e258
feat: Use cache_result instead of raw pair for cache results
Jonas-July Nov 5, 2025
466078b
refactor: DRY load from cache
Jonas-July Nov 5, 2025
a6f3d04
refactor: Make use of optional<T>
Jonas-July Nov 5, 2025
0cf984b
refactor(load.cc): Introduce nodes for loading from source
Jonas-July Nov 9, 2025
5f37e3c
refactor: Correct member variables
Jonas-July Nov 14, 2025
b2bbeb9
feat(load.cc): Load general tree-like cache structures
Jonas-July Nov 14, 2025
813ed32
perf: Move timetables instead of copying during loading
Jonas-July Nov 15, 2025
3d5511c
perf: Use references for temporary merge variables
Jonas-July Nov 15, 2025
35d0396
feat(load.cc): Node indices are independent from the source indices.
Jonas-July Nov 15, 2025
e48dba0
feat(load.cc): Complete Binary Tree Cache Structure
Jonas-July Nov 14, 2025
fa38edf
feat(load.cc): Dynamically match cached nodes
Jonas-July Nov 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/nigiri/shapes_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct shapes_storage {

cista::mmap mm(char const* file);

void add(shapes_storage* other);
std::span<geo::latlng const> get_shape(shape_idx_t) const;
std::span<geo::latlng const> get_shape(trip_idx_t) const;
std::span<geo::latlng const> get_shape(trip_idx_t,
Expand Down
14 changes: 12 additions & 2 deletions include/nigiri/stop.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ namespace nigiri {

struct stop {
using value_type = location_idx_t::value_t;
static constexpr auto const kTotalBits = 8 * sizeof(value_type);
static constexpr auto const kLocationBits = 28U;
static constexpr auto const kMaxLocation =
std::numeric_limits<location_idx_t::value_t>::max() >>
(kTotalBits - kLocationBits);

stop(location_idx_t::value_t const val) {
std::memcpy(this, &val, sizeof(value_type));
Expand All @@ -24,7 +29,12 @@ struct stop {
in_allowed_wheelchair_{in_allowed_wheelchair ? 1U : 0U},
out_allowed_wheelchair_{out_allowed_wheelchair ? 1U : 0U} {}

location_idx_t location_idx() const { return location_idx_t{location_}; }
location_idx_t location_idx() const {
auto const location_idx = location_ != kMaxLocation
? location_idx_t{location_}
: location_idx_t::invalid();
return location_idx;
}
bool in_allowed_wheelchair() const { return in_allowed_wheelchair_ != 0U; }
bool out_allowed_wheelchair() const { return out_allowed_wheelchair_ != 0U; }
bool in_allowed() const { return in_allowed_ != 0U; }
Expand Down Expand Up @@ -72,7 +82,7 @@ struct stop {

friend auto operator<=>(stop const&, stop const&) = default;

location_idx_t::value_t location_ : 28;
location_idx_t::value_t location_ : kLocationBits;
location_idx_t::value_t in_allowed_ : 1;
location_idx_t::value_t out_allowed_ : 1;
location_idx_t::value_t in_allowed_wheelchair_ : 1;
Expand Down
2 changes: 2 additions & 0 deletions include/nigiri/string_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ struct string_store {
cache_ = o.cache_;
resolve();
}
return *this;
}
string_store& operator=(string_store&& o) {
if (&o != this) {
strings_ = std::move(o.strings_);
cache_ = std::move(o.cache_);
resolve();
}
return *this;
}

template <typename Ctx, typename Fn>
Expand Down
2 changes: 2 additions & 0 deletions include/nigiri/timetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ struct timetable {

friend std::ostream& operator<<(std::ostream&, timetable const&);

void merge(timetable const&);

void write(cista::memory_holder&) const;
void write(std::filesystem::path const&) const;
static cista::wrapped<timetable> read(std::filesystem::path const&);
Expand Down
Loading