| Algorithm 2 ODP algorithm | |
| Input: (trajectory), (threshold) | |
| Output: (simplified trajectory) | |
| 1: | function Obstacle_DP |
| 2: | n .size() |
| 3: | , = PerpendicularGeoDistance (, ) |
| 4: | if or LineIntersectPoly |
| 5: | result1 Obstacle_DP |
| 6: | result2 Obstacle_DP |
| 7: | s_trj = [result1 result2] |
| 8: | else |
| 9: | s_trj = [ ] |
| 10: | end if |
| 11: | end function |