Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Holds information about a dem file.
Expand All @@ -32,9 +34,10 @@ public final class SRTM3GeoTiffFile extends ElevationFile {
private final SRTM3GeoTiffElevationModel demModel;

private static final String remoteHTTP1 = "https://download.esa.int/step/auxdata/dem/SRTM90/tiff/";
private static final String remoteHTTP2 = "http://skywatch-auxdata.s3-us-west-2.amazonaws.com/dem/SRTM90/tiff/";

private static String remoteHTTP = Settings.instance().get("DEM.srtm3GeoTiffDEM_HTTP", remoteHTTP1);

private static final Logger logger = Logger.getLogger(SRTM3GeoTiffFile.class.getName());
static {
// if old property files still contain old bucket
if(remoteHTTP.startsWith("http://srtm.csi.cgiar.org") || remoteHTTP.startsWith("http://cgiar-csi-srtm")) {
Expand All @@ -56,14 +59,17 @@ protected ElevationTile createTile(final Product product) throws IOException {
protected Boolean getRemoteFile() {
try {
boolean found = getRemoteHttpFile(remoteHTTP);
if(!found) {
if (!found) {
logger.log(Level.WARNING, localZipFile + " not found at " + remoteHTTP + "trying " + remoteHTTP1);
found = getRemoteHttpFile(remoteHTTP1);
}
return found;
} catch (Exception e) {
logger.log(Level.WARNING, "Unable to download " + localZipFile + " from " + remoteHTTP + " or " + remoteHTTP1, e);
try {
return getRemoteHttpFile(remoteHTTP1);
} catch (Exception e2) {
logger.log(Level.SEVERE, "Unable to download " + localZipFile + " from " + remoteHTTP1, e2);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, here we should probably just throw instead of continue. If we don't then for terrain correction this is called for every single pixel and then does not even stop! Try this:

return false;
}
}
Expand Down