Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java	(revision 35165)
@@ -6,10 +6,11 @@
 import java.util.GregorianCalendar;
 import java.util.List;
-import java.util.Locale;
 
 import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.SystemOfMeasurement;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.WayPoint;
 import org.openstreetmap.josm.plugins.elevation.gpx.GeoidCorrectionKind;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -24,18 +25,6 @@
     }
 
-    public static double METER_TO_FEET = 3.280948;
-
-    /* Countries which use the imperial system instead of the metric system. */
-    private static String[] IMPERIAL_SYSTEM_COUNTRIES = {
-            "en_US",     /* USA */
-            "en_CA",    /* Canada */
-            "en_AU",    /* Australia */
-            "en_NZ",    /* New Zealand */
-            //        "de_DE",    /* for testing only */
-            "en_ZA"    /* South Africa */
-    };
-
     /** The 'no elevation' data magic. */
-    public static double NO_ELEVATION = Double.NaN;
+    public static final double NO_ELEVATION = Double.NaN;
 
     /**
@@ -44,10 +33,8 @@
     public static final String HEIGHT_ATTRIBUTE = "ele";
 
-    private static UnitMode unitMode = UnitMode.NotSelected;
-
     private static GeoidCorrectionKind geoidKind = GeoidCorrectionKind.None;
 
     /** The HGT reader instance. */
-    private static HgtReader hgt = new HgtReader();
+    private static final HgtReader hgt = new HgtReader();
 
     /**
@@ -60,45 +47,4 @@
     public static void setGeoidKind(GeoidCorrectionKind geoidKind) {
         ElevationHelper.geoidKind = geoidKind;
-    }
-
-    /**
-     * Gets the current unit mode (metric or imperial).
-     */
-    public static UnitMode getUnitMode() {
-        //TODO: Use this until /JOSM/src/org/openstreetmap/josm/gui/NavigatableComponent.java
-        // has a an appropriate method
-
-        // unit mode already determined?
-        if (unitMode != UnitMode.NotSelected) {
-            return unitMode;
-        }
-
-        // Set default
-        unitMode = UnitMode.Metric;
-
-        // Check if user could prefer imperial system
-        Locale l = Locale.getDefault();
-        for (int i = 0; i < IMPERIAL_SYSTEM_COUNTRIES.length; i++) {
-            String ctry = l.toString();
-            if (IMPERIAL_SYSTEM_COUNTRIES[i].equals(ctry)) {
-                unitMode = UnitMode.Imperial;
-            }
-        }
-
-        return unitMode;
-    }
-
-    /**
-     * Gets the unit string for elevation ("m" or "ft").
-     */
-    public static String getUnit() {
-        switch (getUnitMode()) {
-        case Metric:
-            return "m";
-        case Imperial:
-            return "ft";
-        default:
-            throw new RuntimeException("Invalid or unsupported unit mode: " + unitMode);
-        }
     }
 
@@ -128,5 +74,5 @@
         double eleInt = getSrtmElevation(wpt.getCoor());
         if (isValidElevation(eleInt)) {
-            return convert(eleInt);
+            return eleInt;
         }
 
@@ -140,11 +86,7 @@
         String height = wpt.getString(ElevationHelper.HEIGHT_ATTRIBUTE);
         try {
-            double z = Double.parseDouble(height);
-
-            return convert(z);
+            return Double.parseDouble(height);
         } catch (NumberFormatException e) {
-            System.err.println(String.format(
-                    "Cannot parse double from '%s': %s", height, e
-                    .getMessage()));
+            Logging.error(String.format("Cannot parse double from '%s': %s", height, e.getMessage()));
             return NO_ELEVATION;
         }
@@ -152,26 +94,5 @@
 
     private static double getElevation(LatLon ll) {
-        double ele = getSrtmElevation(ll);
-        //System.out.println("Get elevation " + ll + " => " + ele);
-        return convert(ele);
-    }
-
-    /**
-     * Converts the value to feet, if required.
-     *
-     * @param ele the elevation to convert
-     * @return the double
-     */
-    private static double convert(double ele) {
-        if (isValidElevation(ele)) {
-            if (getUnitMode() == UnitMode.Imperial) {
-                // translate to feet
-                return meter2Feet(ele);
-            } else {
-                // keep 'as is'
-                return ele;
-            }
-        }
-        return NO_ELEVATION;
+        return getSrtmElevation(ll);
     }
 
@@ -189,7 +110,7 @@
 
         // get distance in meters and divide it by 100 in advance
-        double distInMeter = convert(w1.greatCircleDistance(w2) / 100.0);
-
-        // get elevation (difference) - is converted automatically to feet
+        double distInMeter = w1.greatCircleDistance(w2) / 100.0;
+
+        // get elevation (difference)
         int ele1 = (int) ElevationHelper.getElevation(w1);
         int ele2 = (int) ElevationHelper.getElevation(w2);
@@ -201,18 +122,8 @@
 
     /**
-     * Converts meter into feet
-     *
-     * @param meter the meter
-     * @return the double
-     */
-    public static double meter2Feet(double meter) {
-        return meter * METER_TO_FEET;
-    }
-
-    /**
      * Gets the elevation string for a given elevation, e. g "300m" or "800ft".
      */
     public static String getElevationText(int elevation) {
-        return String.format("%d %s", elevation, getUnit());
+        return SystemOfMeasurement.getSystemOfMeasurement().getDistText(elevation);
     }
 
@@ -221,5 +132,5 @@
      */
     public static String getElevationText(double elevation) {
-        return String.format("%d %s", (int) Math.round(elevation), getUnit());
+        return SystemOfMeasurement.getSystemOfMeasurement().getDistText((int) Math.round(elevation));
     }
 
@@ -233,6 +144,5 @@
         if (wpt == null) return "-";
 
-        int elevation = (int) Math.round(ElevationHelper.getElevation(wpt));
-        return String.format("%d %s", elevation, getUnit());
+        return getElevationText(ElevationHelper.getElevation(wpt));
     }
 
@@ -262,5 +172,4 @@
             double eleHgt = hgt.getElevationFromHgt(ll);
 
-            //System.out.println("Get elevation from HGT " + ll + " => " + eleHgt);
             if (isValidElevation(eleHgt)) {
                 return eleHgt;
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java	(revision 35165)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -60,10 +61,10 @@
             return readElevation(coor);
         } catch (FileNotFoundException e) {
-            System.err.println("Get elevation from HGT " + coor + " failed: => " + e.getMessage());
+            Logging.error("Get elevation from HGT " + coor + " failed: => " + e.getMessage());
             // no problem... file not there
             return ElevationHelper.NO_ELEVATION;
         } catch (Exception ioe) {
             // oops...
-            ioe.printStackTrace(System.err);
+            Logging.error(ioe);
             // fallback
             return ElevationHelper.NO_ELEVATION;
@@ -86,5 +87,4 @@
 
             bb.flip();
-            //sb = bb.order(ByteOrder.LITTLE_ENDIAN).asShortBuffer();
             sb = bb.order(ByteOrder.BIG_ENDIAN).asShortBuffer();
         } finally {
@@ -122,10 +122,7 @@
         int cell = (HGT_ROW_LENGTH * (row - 1)) + col;
 
-        //System.out.println("Read SRTM elevation data from row/col/cell " + row + "," + col + ", " + cell + ", " + sb.limit());
-
         // valid position in buffer?
         if (cell < sb.limit()) {
             short ele = sb.get(cell);
-            //System.out.println("==> Read SRTM elevation data from row/col/cell " + row + "," + col + ", " + cell + " = " + ele);
             // check for data voids
             if (ele == HGT_VOID) {
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/EleVertex.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/EleVertex.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/EleVertex.java	(revision 35165)
@@ -59,14 +59,7 @@
             for (int j = i + 1; j < points.length; j++) {
                 EleCoordinate c2 = points[j];
-
                 edges[k++] = new TriangleEdge(i, j, c1.greatCircleDistance(c2));
             }
         }
-
-        /*
-    for (int i = 0; i < edges.length; i++) {
-        TriangleEdge triangleEdge = edges[i];
-        System.out.println("#" + i + ": " +triangleEdge);
-    }*/
 
         // sort by distance
@@ -75,16 +68,9 @@
         TriangleEdge longest = edges[0];
 
-
-        //System.out.println("Longest " + longest);
         EleCoordinate pI = points[longest.getI()];
         EleCoordinate pJ = points[longest.getJ()];
         EleCoordinate pK = points[longest.getK()];
         EleCoordinate newP = getMid(pI, pJ);
-        /*
-    System.out.println(pI);
-    System.out.println(pJ);
-    System.out.println(pK);
-    System.out.println(newP);
-         */
+
         List<EleVertex> res = new ArrayList<>();
         res.add(new EleVertex(pI, pK, newP));
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridLayer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridLayer.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridLayer.java	(revision 35165)
@@ -64,5 +64,4 @@
             tileSet = new TileSet(box.getMin(), box.getMax(), ELE_ZOOM_LEVEL); // we use a vector format with constant zoom level
             lastBounds = box;
-            System.out.println("paint " + tileSet);
         }
 
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridTile.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridTile.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridTile.java	(revision 35165)
@@ -15,5 +15,4 @@
 
 import org.openstreetmap.gui.jmapviewer.Tile;
-import org.openstreetmap.gui.jmapviewer.interfaces.TileCache;
 import org.openstreetmap.gui.jmapviewer.interfaces.TileSource;
 import org.openstreetmap.josm.data.Bounds;
@@ -41,20 +40,4 @@
             BufferedImage image) {
         super(source, xtile, ytile, zoom, image);
-
-
-    }
-
-    @Override
-    public void loadPlaceholderFromCache(TileCache cache) {
-        // TODO Auto-generated method stub
-        super.loadPlaceholderFromCache(cache);
-
-        //System.out.println("loadPlaceholderFromCache");
-    }
-
-    @Override
-    public String getUrl() throws IOException {
-        // TODO Auto-generated method stub
-        return super.getUrl();
     }
 
@@ -67,5 +50,4 @@
         super.paint(g, x, y);
 
-        //g.drawString(String.format("EGT %d/%d ", getXtile(), getYtile()), x, y);
         g.drawString(getStatus(), x, y);
     }
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java	(revision 35165)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.plugins.elevation.gpx.ElevationWayPointKind;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -65,6 +66,5 @@
 
         if (wpt == null || profile == null) {
-            System.err.println(String.format(
-                    "Cannot determine color: prof=%s, wpt=%s", profile, wpt));
+            Logging.error(String.format("Cannot determine color: prof=%s, wpt=%s", profile, wpt));
             return null;
         }
@@ -113,6 +113,5 @@
 
         if (wpt == null) {
-            System.err.println(String.format(
-                    "Cannot paint: mv=%s, prof=%s, wpt=%s", mv, profile, wpt));
+            Logging.error(String.format("Cannot paint: mv=%s, prof=%s, wpt=%s", mv, profile, wpt));
             return;
         }
@@ -142,6 +141,5 @@
 
         if (wpt1 == null || wpt2 == null) {
-            System.err.println(String.format(
-                    "Cannot paint line: mv=%s, prof=%s, kind = %s", mv, profile, kind));
+            Logging.error(String.format("Cannot paint line: mv=%s, prof=%s, kind = %s", mv, profile, kind));
             return;
         }
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 35164)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 35165)
@@ -26,4 +26,5 @@
 
 import org.openstreetmap.josm.data.SystemOfMeasurement;
+import org.openstreetmap.josm.data.SystemOfMeasurement.SoMChangeListener;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -49,5 +50,6 @@
  * connection between layer and elevation profile.
  */
-public class ElevationProfileDialog extends ToggleDialog implements LayerChangeListener, ActiveLayerChangeListener, ComponentListener {
+public class ElevationProfileDialog extends ToggleDialog
+implements LayerChangeListener, ActiveLayerChangeListener, ComponentListener, SoMChangeListener {
 
     private static final String EMPTY_DATA_STRING = "-";
@@ -198,4 +200,5 @@
     @Override
     public void showNotify() {
+        SystemOfMeasurement.addSoMChangeListener(this);
         MainApplication.getLayerManager().addLayerChangeListener(this);
         MainApplication.getLayerManager().addActiveLayerChangeListener(this);
@@ -212,4 +215,5 @@
         MainApplication.getLayerManager().removeActiveLayerChangeListener(this);
         MainApplication.getLayerManager().removeLayerChangeListener(this);
+        SystemOfMeasurement.removeSoMChangeListener(this);
     }
 
@@ -469,3 +473,8 @@
         }
     }
+
+    @Override
+    public void systemOfMeasurementChanged(String oldSoM, String newSoM) {
+        updateView();
+    }
 }
