]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/save/GpxExporter.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / save / GpxExporter.java
index 19007ac920dc33c45c2522def2adb648ea1368c7..a4ac1a7de2e72ade39734e7f0099fe6e14f5faca 100644 (file)
@@ -35,7 +35,6 @@ import tim.prune.GpsPrune;
 import tim.prune.I18nManager;
 import tim.prune.UpdateMessageBroker;
 import tim.prune.config.Config;
-import tim.prune.data.Altitude;
 import tim.prune.data.AudioClip;
 import tim.prune.data.Coordinate;
 import tim.prune.data.DataPoint;
@@ -45,6 +44,7 @@ import tim.prune.data.Photo;
 import tim.prune.data.RecentFile;
 import tim.prune.data.Timestamp;
 import tim.prune.data.TrackInfo;
+import tim.prune.data.UnitSetLibrary;
 import tim.prune.gui.DialogCloser;
 import tim.prune.load.GenericFileFilter;
 import tim.prune.save.xml.GpxCacherList;
@@ -530,7 +530,7 @@ public class GpxExporter extends GenericFunction implements Runnable
                // Point has been modified - maybe it's possible to modify the source
                source = replaceGpxTags(source, "lat=\"", "\"", inPoint.getLatitude().output(Coordinate.FORMAT_DECIMAL_FORCE_POINT));
                source = replaceGpxTags(source, "lon=\"", "\"", inPoint.getLongitude().output(Coordinate.FORMAT_DECIMAL_FORCE_POINT));
-               source = replaceGpxTags(source, "<ele>", "</ele>", inPoint.getAltitude().getStringValue(Altitude.Format.METRES));
+               source = replaceGpxTags(source, "<ele>", "</ele>", inPoint.getAltitude().getStringValue(UnitSetLibrary.UNITS_METRES));
                source = replaceGpxTags(source, "<time>", "</time>", inPoint.getTimestamp().getText(Timestamp.FORMAT_ISO_8601));
                if (inPoint.isWaypoint())
                {
@@ -694,6 +694,7 @@ public class GpxExporter extends GenericFunction implements Runnable
                if (inCachers != null) {gpxHeader = inCachers.getFirstHeader();}
                if (gpxHeader == null || gpxHeader.length() < 5)
                {
+                       // TODO: Consider changing this to default to GPX 1.1
                        // Create default (1.0) header
                        gpxHeader = "<gpx version=\"1.0\" creator=\"" + GPX_CREATOR
                                + "\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
@@ -726,7 +727,7 @@ public class GpxExporter extends GenericFunction implements Runnable
                if (inPoint.hasAltitude())
                {
                        inWriter.write("\t\t<ele>");
-                       inWriter.write("" + inPoint.getAltitude().getStringValue(Altitude.Format.METRES));
+                       inWriter.write("" + inPoint.getAltitude().getStringValue(UnitSetLibrary.UNITS_METRES));
                        inWriter.write("</ele>\n");
                }
                // timestamp if available (point might have timestamp and then be turned into a waypoint)
@@ -798,7 +799,7 @@ public class GpxExporter extends GenericFunction implements Runnable
                if (inPoint.hasAltitude())
                {
                        inWriter.write("<ele>");
-                       inWriter.write("" + inPoint.getAltitude().getStringValue(Altitude.Format.METRES));
+                       inWriter.write("" + inPoint.getAltitude().getStringValue(UnitSetLibrary.UNITS_METRES));
                        inWriter.write("</ele>");
                }
                // timestamp if available (and selected)