Marker: hold unique reference to TrackPoint. #1831
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OpenTracks only allows to create Markers if a valid location is available (i.e., a TrackPoint with location was stored).
However, in the current implementation the TrackPoint and Marker tables are independent (i.e., Markers also store lat/lng, altitude etc) and they are just indirectly linked together by
time
.In addition, Markers have the
duration
andlength
(here distance) for being rendered on the charts.This PR changes this on database level by adding a reference for each Marker to one TrackPoint.
However: Both GPX and KML allow to import Markers that are not related to any TrackPoint within a Track.
This implies that people might have Markers that cannot be linked to a TrackPoint - they might not even be close to any TrackPoint (in time as well as location).
Even worse people might have imported such Tracks on purpose to show the Markers with OSMDashboard or just to store all their tracking data in OpenTracks (from other application).
Question: Should OpenTracks internal data model reflect how OpenTracks works or rather keep the existing functionality?
PS/ I am not even sure that the functionality was intended this way...