Cleanup: removed import functionality for legacy format (coordinates 100 and 200 where special).

Deadline was EOF 2021.
This commit is contained in:
Dennis Guse
2025-12-06 10:23:21 +01:00
parent 56c6cb1f19
commit ef111b7959
3 changed files with 0 additions and 140 deletions
@@ -61,73 +61,6 @@ public class GPXTrackImporterTest {
}
}
/**
* Check that data that contains pause (lat=100, lng=0) and resume (lat=200, lng=0) locations are restored to a segment break.
*/
@LargeTest
@Test
public void gpx_with_pause_resume() throws IOException {
// given
XMLImporter importer = new XMLImporter(new GPXTrackImporter(context, trackImporter));
InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getResources().openRawResource(de.dennisguse.opentracks.test.R.raw.legacy_gpx_pause_resume);
// when
// 1. import
importTrackId = importer.importFile(inputStream).get(0);
// then
// 2. track
Track importedTrack = contentProviderUtils.getTrack(importTrackId);
assertNotNull(importedTrack);
assertEquals(ActivityType.UNKNOWN, importedTrack.activityType());
assertEquals("the category", importedTrack.activityTypeLocalized());
assertEquals("the description", importedTrack.description());
assertEquals("2021-01-07 22:51", importedTrack.name());
assertEquals(ActivityType.UNKNOWN, importedTrack.activityType());
//TODO Check trackstatistics
// 3. trackpoints
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
assertEquals(6, importedTrackPoints.size());
// first segment
TrackPointAssert a = new TrackPointAssert();
a.assertEquals(List.of(
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
new Position(
Instant.parse("2021-01-07T21:51:59.179Z"),
3d, 14d, null,
Altitude.WGS84.of(10), null,
null,
null)),
new TrackPoint(TrackPoint.Type.TRACKPOINT,
new Position(
Instant.parse("2021-01-07T21:52:00.653Z"),
3d, 14.001, null,
Altitude.WGS84.of(10), null,
null,
Speed.of(75.4192))),
new TrackPoint(TrackPoint.Type.TRACKPOINT,
new Position(
Instant.parse("2021-01-07T21:52:01.010Z"),
3d, 14.002, null,
Altitude.WGS84.of(10), null,
null, Speed.of(311.3948))),
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse("2021-01-07T21:52:02.658Z")),
// created resume trackpoint with time of next valid trackpoint
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse("2021-01-07T21:52:03.873Z")),
new TrackPoint(TrackPoint.Type.TRACKPOINT,
new Position(
Instant.parse("2021-01-07T21:52:04.103Z"),
3d, 14.003, null,
Altitude.WGS84.of(10), null,
null,
null))
), importedTrackPoints);
}
@LargeTest
@Test
public void gpx_without_speed() throws IOException {