+ boolean hasZeroAltitudePoints = false;
+ boolean hasNonZeroAltitudePoints = false;
+ // First, loop to see what kind of points we have
+ for (int i=0; i<track.getNumPoints(); i++)
+ {
+ if (track.getPoint(i).hasAltitude())
+ {
+ if (track.getPoint(i).getAltitude().getValue() == 0) {
+ hasZeroAltitudePoints = true;
+ }
+ else {
+ hasNonZeroAltitudePoints = true;
+ }
+ }
+ }
+ // Should we overwrite the zero altitude values?
+ boolean overwriteZeros = hasZeroAltitudePoints && !hasNonZeroAltitudePoints;
+ // If non-zero values present as well, ask user whether to overwrite the zeros or not
+ if (hasNonZeroAltitudePoints && hasZeroAltitudePoints && JOptionPane.showConfirmDialog(_parentFrame,
+ I18nManager.getText("dialog.lookupsrtm.overwritezeros"), I18nManager.getText(getNameKey()),
+ JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
+ {
+ overwriteZeros = true;
+ }
+
+ _dialog.setVisible(true);
+ // Now loop again to extract the required tiles