]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/save/KmlExporter.java
Version 17, September 2014
[GpsPrune.git] / tim / prune / save / KmlExporter.java
index 6fbf7498bf4651e3445e00ae7f566703bc615cd1..50386ccebeea79a057e56fa18d925fcac546d00d 100644 (file)
@@ -51,11 +51,11 @@ import tim.prune.data.Timestamp;
 import tim.prune.data.Track;
 import tim.prune.data.TrackInfo;
 import tim.prune.data.UnitSetLibrary;
-import tim.prune.gui.ColourChooser;
-import tim.prune.gui.ColourPatch;
 import tim.prune.gui.DialogCloser;
 import tim.prune.gui.ImageUtils;
 import tim.prune.gui.WholeNumberField;
+import tim.prune.gui.colour.ColourChooser;
+import tim.prune.gui.colour.ColourPatch;
 import tim.prune.load.GenericFileFilter;
 import tim.prune.save.xml.XmlUtils;
 
@@ -525,7 +525,7 @@ public class KmlExporter extends GenericFunction implements Runnable
                        }
                        // Make a blob with description for each photo
                        // Photos have already been written so picture sizes already known
-                       if (point.getPhoto() != null && writePhotos && writeCurrentPoint)
+                       if (point.getPhoto() != null && point.getPhoto().isValid() && writePhotos && writeCurrentPoint)
                        {
                                if (!writtenPhotoHeader)
                                {
@@ -684,7 +684,7 @@ public class KmlExporter extends GenericFunction implements Runnable
                                        // Add timestamp (if any) to the list
                                        whenList.append("<when>");
                                        if (point.hasTimestamp()) {
-                                               whenList.append(point.getTimestamp().getText(Timestamp.FORMAT_ISO_8601));
+                                               whenList.append(point.getTimestamp().getText(Timestamp.Format.ISO8601));
                                        }
                                        whenList.append("</when>\n");
                                        // Add coordinates to the list
@@ -876,21 +876,21 @@ public class KmlExporter extends GenericFunction implements Runnable
                ImageWriter imageWriter = writers.next();
 
                // Check selection checkbox
-               boolean justSelection = _pointTypeSelector.getJustSelection();
+               final boolean justSelection = _pointTypeSelector.getJustSelection();
                int selStart = -1, selEnd = -1;
                if (justSelection) {
                        selStart = _trackInfo.getSelection().getStart();
                        selEnd = _trackInfo.getSelection().getEnd();
                }
 
-               int numPoints = _track.getNumPoints();
+               final int numPoints = _track.getNumPoints();
                DataPoint point = null;
                int photoNum = 0;
                // Loop over all points in track
                for (int i=0; i<numPoints && !_cancelPressed; i++)
                {
                        point = _track.getPoint(i);
-                       if (point.getPhoto() != null && (!justSelection || (i>=selStart && i<=selEnd)))
+                       if (point.getPhoto() != null && point.getPhoto().isValid() && (!justSelection || (i>=selStart && i<=selEnd)))
                        {
                                photoNum++;
                                // Make a new entry in zip file