X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fsrtm%2FLookupSrtmFunction.java;h=1bf26cd8646c9b36ad8761f07b74c55f0636a978;hp=30183d2d6cd13c0e780a018bc4ca6dd1ba2444b5;hb=140e9d165f85c3d4f0435a311e091209313faa2a;hpb=c0387c124840c9407e040600fda88f3c3e8f6aa6 diff --git a/tim/prune/function/srtm/LookupSrtmFunction.java b/tim/prune/function/srtm/LookupSrtmFunction.java index 30183d2..1bf26cd 100644 --- a/tim/prune/function/srtm/LookupSrtmFunction.java +++ b/tim/prune/function/srtm/LookupSrtmFunction.java @@ -15,6 +15,7 @@ import java.util.zip.ZipInputStream; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JProgressBar; @@ -48,6 +49,7 @@ public class LookupSrtmFunction extends GenericFunction implements Runnable /** Altitude below which is considered void */ private static final int VOID_VAL = -32768; + /** * Constructor * @param inApp App object @@ -114,14 +116,40 @@ public class LookupSrtmFunction extends GenericFunction implements Runnable */ public void run() { - _dialog.setVisible(true); // Compile list of tiles to get Track track = _app.getTrackInfo().getTrack(); ArrayList tileList = new ArrayList(); + boolean hasZeroAltitudePoints = false; + boolean hasNonZeroAltitudePoints = false; + // First, loop to see what kind of points we have + for (int i=0; i inTileList, boolean inOverwriteZeros) + { + Track track = _app.getTrackInfo().getTrack(); UndoLookupSrtm undo = new UndoLookupSrtm(_app.getTrackInfo()); int numAltitudesFound = 0; // Update progress bar - _progressBar.setMaximum(tileList.size()); - _progressBar.setIndeterminate(tileList.size() <= 1); + _progressBar.setMaximum(inTileList.size()); + _progressBar.setIndeterminate(inTileList.size() <= 1); _progressBar.setValue(0); // Get urls for each tile - URL[] urls = TileFinder.getUrls(tileList); - for (int t=0; t 0) { + _app.showErrorMessage(getNameKey(), "error.lookupsrtm.nonefound"); + } else { - _app.showErrorMessage(getNameKey(), "error.lookupsrtm.none"); + _app.showErrorMessage(getNameKey(), "error.lookupsrtm.nonerequired"); } }