forked from upstream-mirrors/OpenTracks
TrackRecordingManager: store GPS-based TrackPoints based upon the distance to the previously stored GPS-based TrackPoint.
This commit is contained in:
@@ -324,6 +324,11 @@ public class TrackPoint {
|
||||
if (hasSensorDistance()) {
|
||||
return getSensorDistance();
|
||||
}
|
||||
return distanceToPreviousFromLocation(previous);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Distance distanceToPreviousFromLocation(@NonNull TrackPoint previous) {
|
||||
if (!hasLocation() || hasLocation() != previous.hasLocation()) {
|
||||
throw new RuntimeException("Cannot compute distance.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user