Issue #213: Project invalid trajectories inside walkable area #506
Issue #213: Project invalid trajectories inside walkable area #506awestphal1 merged 27 commits intoPedestrianDynamics:mainfrom
Conversation
…correct adjustments
schroedtert
left a comment
There was a problem hiding this comment.
This is just the start to get the unit tests running again. Took a brief look at the pre-commit checks, some of them fail due to wrong format of the docstrings, which should be easily fixable. If you need help setting up the pre-commit checks locally let me know. I will have a more in-depth review in the next days.
schroedtert
left a comment
There was a problem hiding this comment.
I finally had the time for a more in-depth review, but I skipped the math part, maybe someone else will have a look at that.
There are some general remarks, which we may have to discuss with the others. Personally I would prefer to get the functionality quickly into the main branch and do optimizations then. Otherwise it will take too long to get it included. What do you think.
- You transfer the shapely data structures into float values. Would't it be easier to just keep them and pass them to the functions?
- When dealing with DataFrames, Numpy and Shapely there is usually a way to avoid looping over everything and performing an action on an individual row/data point/geometry. My feeling tells me, that is also possible here, but I would also need a deeper dive into the code test it.
I really like that you already added some unit tests! This gives me a lot of confidence that this works as expected. And as an additional advantage it make optimization and refactoring way easier!
If you don't understand one of the comments or disagree, don't hesitate to contact me (RC or answer to the comment). The comments marked as optional you can resolve yourself if currently too much effort.
|
As discussed in the dev-meeting last week, here is a follow-up ticket #518, where we can deal with the open points. Hopefully I didn't miss any important task. Before merging, please get a final review from @JuleAdrian and merge the latest changes and resolve the conflict. |
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

Added a new preprocessing directory containing the trajectory_projector file.
The function correct_invalid_trajectories identifies every invalid point of a trajectory and moves it outside the geometry.
The direction and the new distance between the point and the wall are computed using trigonometric methods and linear interpolation. Points that lie deeper inside a wall are shifted a shorter distance outward, while points that are already close to the boundary are moved farther.
Closes #213