- Timestamp:
- 2012-08-23T23:37:57+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r5268 r5474 100 100 /** 101 101 * Replies the coordinate in degrees/minutes/seconds format 102 * @param pCoordinate The coordinate to convert 103 * @return The coordinate in degrees/minutes/seconds format 102 104 */ 103 105 public static String dms(double pCoordinate) { … … 108 110 int tMinutes = (int) tTmpMinutes; 109 111 double tSeconds = (tTmpMinutes - tMinutes) * 60; 110 111 return tDegree + "\u00B0" + cDmsMinuteFormatter.format(tMinutes) + "\'" 112 + cDmsSecondFormatter.format(tSeconds) + "\""; 113 } 114 112 113 String sDegrees = Integer.toString(tDegree); 114 String sMinutes = cDmsMinuteFormatter.format(tMinutes); 115 String sSeconds = cDmsSecondFormatter.format(tSeconds); 116 117 if (sSeconds.equals("60.0")) { 118 sSeconds = "00.0"; 119 sMinutes = cDmsMinuteFormatter.format(tMinutes+1); 120 } 121 if (sMinutes.equals("60")) { 122 sMinutes = "00"; 123 sDegrees = Integer.toString(tDegree+1); 124 } 125 126 return sDegrees + "\u00B0" + sMinutes + "\'" + sSeconds + "\""; 127 } 128 129 /** 130 * Replies the coordinate in degrees/minutes format 131 * @param pCoordinate The coordinate to convert 132 * @return The coordinate in degrees/minutes format 133 */ 115 134 public static String dm(double pCoordinate) { 116 135 … … 118 137 int tDegree = (int) tAbsCoord; 119 138 double tMinutes = (tAbsCoord - tDegree) * 60; 120 return tDegree + "\u00B0" + cDmMinuteFormatter.format(tMinutes) + "\'"; 139 140 String sDegrees = Integer.toString(tDegree); 141 String sMinutes = cDmMinuteFormatter.format(tMinutes); 142 143 if (sMinutes.equals("60.000")) { 144 sMinutes = "00.000"; 145 sDegrees = Integer.toString(tDegree+1); 146 } 147 148 return sDegrees + "\u00B0" + sMinutes + "\'"; 121 149 } 122 150
Note:
See TracChangeset
for help on using the changeset viewer.