Shapes storage: add option to keep shape data#318
Conversation
|
While the code looks fine, I'm worried about the constantly growing file size in the long run. Especially if the import runs daily. |
|
Garbage collection via "copy everything that's still referenced" should be more or less trivial to implement? |
|
I think, that should be a viable solution. While copying will temporary require some additional space, it's probably less than what we get from old, unused shapes from timetables. Depending on the feeds and configuration. |
This adds an option
keep_shape_datatoshapes_storage. If set to true and the data files already exist, the existing shapes data files are reused and new shapes are appended. This only applies to the shapes themselves (shapes_data.bin,shapes_idx.bin,shape_sources.bin), as the other files depend on route or trip indices.The goal of this change is to enable the reuse of existing routed shapes from previous timetable imports (via an additional cache file that maps stop sequences to shape indices - implemented in motis).
Note that shapes from the timetable (shapes.txt) are always appended, so the shapes data files grow with every import if this flag is enabled.