mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 09:53:06 +02:00
Reorder waypoint and track writing on export.
The GPX schema requires waypoints to come before the track. Waypoints are not currently used in TCX export, so there are no changes there. In KML files, both tracks and waypoints are "Placemark"s, so it doesn't matter what order they come in there. This does change the order they appear in CSV files, which could potentially invalidate some assumptions made in downstream tools.
This commit is contained in:
@@ -267,8 +267,13 @@ public class TrackWriterTest extends AndroidTestCase {
|
||||
wpt.setId(i + 1);
|
||||
}
|
||||
|
||||
// Begin the track
|
||||
formatWriter.writeHeader();
|
||||
|
||||
// Expect reading/writing of the waypoints (except the first)
|
||||
formatWriter.writeWaypoint(wptEq(wps[1]));
|
||||
formatWriter.writeWaypoint(wptEq(wps[2]));
|
||||
|
||||
// Begin the track
|
||||
formatWriter.writeBeginTrack(locEq(locs[0]));
|
||||
|
||||
// Write locations 1-2
|
||||
@@ -289,10 +294,6 @@ public class TrackWriterTest extends AndroidTestCase {
|
||||
// End the track
|
||||
formatWriter.writeEndTrack(locEq(locs[5]));
|
||||
|
||||
// Expect reading/writing of the waypoints (except the first)
|
||||
formatWriter.writeWaypoint(wptEq(wps[1]));
|
||||
formatWriter.writeWaypoint(wptEq(wps[2]));
|
||||
|
||||
formatWriter.writeFooter();
|
||||
formatWriter.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user