Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r12538 r12561 205 205 * @param pCoordinate The coordinate to convert 206 206 * @return The coordinate in degrees/minutes/seconds format 207 */ 207 * @deprecated use {@link #degreesMinutesSeconds} instead 208 */ 209 @Deprecated 208 210 public static String dms(double pCoordinate) { 211 return degreesMinutesSeconds(pCoordinate); 212 } 213 214 /** 215 * Replies the coordinate in degrees/minutes/seconds format 216 * @param pCoordinate The coordinate to convert 217 * @return The coordinate in degrees/minutes/seconds format 218 * @since 12561 219 */ 220 public static String degreesMinutesSeconds(double pCoordinate) { 209 221 210 222 double tAbsCoord = Math.abs(pCoordinate); … … 302 314 switch(d) { 303 315 case DECIMAL_DEGREES: return cDdFormatter.format(y); 304 case DEGREES_MINUTES_SECONDS: return d ms(y) + ((y < 0) ? SOUTH : NORTH);316 case DEGREES_MINUTES_SECONDS: return degreesMinutesSeconds(y) + ((y < 0) ? SOUTH : NORTH); 305 317 case NAUTICAL: return degreesMinutes(y) + ((y < 0) ? SOUTH : NORTH); 306 318 case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().north()); … … 322 334 switch(d) { 323 335 case DECIMAL_DEGREES: return cDdFormatter.format(x); 324 case DEGREES_MINUTES_SECONDS: return d ms(x) + ((x < 0) ? WEST : EAST);336 case DEGREES_MINUTES_SECONDS: return degreesMinutesSeconds(x) + ((x < 0) ? WEST : EAST); 325 337 case NAUTICAL: return degreesMinutes(x) + ((x < 0) ? WEST : EAST); 326 338 case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().east()); -
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r11745 r12561 104 104 assertNotNull(latlon); 105 105 DecimalFormat f = new DecimalFormat("00.0"); 106 assertEquals("51°46'"+f.format(43.0)+"\"", LatLon.d ms(latlon.lat()));107 assertEquals("8°21'"+f.format(56.3)+"\"", LatLon.d ms(latlon.lon()));106 assertEquals("51°46'"+f.format(43.0)+"\"", LatLon.degreesMinutesSeconds(latlon.lat())); 107 assertEquals("8°21'"+f.format(56.3)+"\"", LatLon.degreesMinutesSeconds(latlon.lon())); 108 108 } 109 109
Note:
See TracChangeset
for help on using the changeset viewer.