Ticket #4645: patch-east-north.txt

File patch-east-north.txt, 1.9 KB (added by tibob <robert@…>, 2 years ago)
Line 
1Index: src/org/openstreetmap/josm/data/coor/CoordinateFormat.java
2===================================================================
3--- src/org/openstreetmap/josm/data/coor/CoordinateFormat.java  (Revision 3065)
4+++ src/org/openstreetmap/josm/data/coor/CoordinateFormat.java  (Arbeitskopie)
5@@ -17,8 +17,13 @@
6     /**
7      * the minutes/seconds format 99" 99'
8      */
9-    DEGREES_MINUTES_SECONDS (tr("Degrees Minutes Seconds"));
10+    DEGREES_MINUTES_SECONDS (tr("Degrees Minutes Seconds")),
11 
12+    /**
13+     * coordinates East/North
14+     */
15+    EAST_NORTH (tr("East/North"));
16+
17     private String displayName;
18     private CoordinateFormat(String displayName) {
19         this.displayName = displayName;
20Index: src/org/openstreetmap/josm/data/coor/LatLon.java
21===================================================================
22--- src/org/openstreetmap/josm/data/coor/LatLon.java    (Revision 3065)
23+++ src/org/openstreetmap/josm/data/coor/LatLon.java    (Arbeitskopie)
24@@ -9,6 +9,7 @@
25 import static java.lang.Math.sin;
26 import static java.lang.Math.sqrt;
27 import static java.lang.Math.toRadians;
28+import static java.lang.Math.round;
29 
30 import java.text.DecimalFormat;
31 import java.text.NumberFormat;
32@@ -95,6 +96,8 @@
33         case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ?
34                 /* short symbol for South */ trc("compass", "S") :
35                     /* short symbol for North */ trc("compass", "N"));
36+        case EAST_NORTH:
37+            return String.valueOf(round(Main.proj.latlon2eastNorth(this).east()));
38         default: return "ERR";
39         }
40     }
41@@ -109,6 +112,8 @@
42         case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ?
43                 /* short symbol for West */ trc("compass", "W") :
44                     /* short symbol for East */ trc("compass", "E"));
45+        case EAST_NORTH:
46+            return String.valueOf(round(Main.proj.latlon2eastNorth(this).north()));
47         default: return "ERR";
48         }
49     }