trackintel icon indicating copy to clipboard operation
trackintel copied to clipboard

Enable caching for distance calculation

Open henrymartin1 opened this issue 2 years ago • 0 comments

Calculating distances on a large dataset is an expensive operation, especially if we need to use the function calculate_haversine_length. This function is used by several functions (calculate_modal_split, predict_transport_mode) and additionally a user might want to have access to the length as well.

It would be great if we could implement a way to cache the calculation e.g., in a column of the input dataframe. I am not sure yet what would be a good concept that is still easy to use. An idea would be to return the column if calculated as optional output if caching is activated.

henrymartin1 avatar May 23 '22 15:05 henrymartin1