trackintel
trackintel copied to clipboard
Enable caching for distance calculation
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.