Develop
Ticket #956 (closed defect: fixed)
Loading a task file may incorrectly shift turnpoints depending on waypoint file
| Reported by: | RobD | Owned by: | Turbo |
|---|---|---|---|
| Priority: | highest | Milestone: | XCSoar 6.1 |
| Component: | Task | Version: | 6.0 |
| Keywords: | task, waypoint | Cc: |
Description
Currently, when a task is loaded from a .TSK or .CUP file, we dedupe the task's turnpoints against the current waypoint database, with a range of 100m to match points.
The problem is that moving a task point by 100m may (1) invalidate a task or (2) make the turnpoint unreachable; e.g. on the backside of a ridge etc.
The dedupe altorithm see (ticket #559) must not alter the geometry of the task or the locations of the points. Suggest if we find a waypoint within 100m that is more than say "2 meters" which is a reasonable rounding error, then we don't dedupe. Instead we create a new waypoint in the exact location of the task point and copy the attributes of the waypoint in the waypoint database (altitude, landable/airport flags etc) to the newly created task waypoint from the Task file.
Change History
comment:2 Changed 2 years ago by jeff1
I recommend to always use the turnpoint locations from the taskfile. If duplicate points are in the waypoint file a notification is required, maybe the user could choose if the point from the waypoint file should remain visible in additions or its name/properties be used, but the locations should (for the time the task is selected) be the ones loaded from the taskfile to guarantee adherence to the competition's task description.
comment:4 Changed 2 years ago by RobD
this potentially includes the following changes:
1) calling the waypoint_dedupe routine at all the touchpoints where the task and/or waypoint file is altered. This includes startup w/ Default.tsk loading and dlgConfiguration when waypoint file is changed. Also standardize how we do this. The deserialize routines have similar but not identical dedupe methods (they use location, not name).
2) removing calls to the waypoint dedupe routine from dlgwaypointDetails (won't be necessary if (1) above.
2) fixing the waypoint_dedupe routine. It currently adds the same waypoint twice if it's repeated in the task. (there is also code does not appear to do anything)
3) addressing performance issues with waypoint_Dedupe -- if we're calling it during startup, with large waypoint files.
4) consideration of a UI when a task or waypoint file is loaded that prompts the user for potentially duplicate waypoints. "XY is close to YZ -- use YZ instead of XY?"
comment:5 Changed 2 years ago by Turbo
- Milestone changed from XCSoar 6.0.x to XCSoar 6.1
since there will be no further 6.0.x release we should fix this ticket for the 6.1 release

I'm unceratain about the best behaviour. See You Desktop also will shift the task points if they have the same name up to a couple hundred meters, with no prompting. If the Name is different, See You desktop will prompt "Waypoint ABC is close to XYZ. Do you want to add waypoint ABC?"