Changeset 12561 in josm for trunk


Ignore:
Timestamp:
2017-08-02T23:17:16+02:00 (7 years ago)
Author:
Don-vip
Message:

deprecate LatLon.dms

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r12538 r12561  
    205205     * @param pCoordinate The coordinate to convert
    206206     * @return The coordinate in degrees/minutes/seconds format
    207      */
     207     * @deprecated use {@link #degreesMinutesSeconds} instead
     208     */
     209    @Deprecated
    208210    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) {
    209221
    210222        double tAbsCoord = Math.abs(pCoordinate);
     
    302314        switch(d) {
    303315        case DECIMAL_DEGREES: return cDdFormatter.format(y);
    304         case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ? SOUTH : NORTH);
     316        case DEGREES_MINUTES_SECONDS: return degreesMinutesSeconds(y) + ((y < 0) ? SOUTH : NORTH);
    305317        case NAUTICAL: return degreesMinutes(y) + ((y < 0) ? SOUTH : NORTH);
    306318        case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().north());
     
    322334        switch(d) {
    323335        case DECIMAL_DEGREES: return cDdFormatter.format(x);
    324         case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ? WEST : EAST);
     336        case DEGREES_MINUTES_SECONDS: return degreesMinutesSeconds(x) + ((x < 0) ? WEST : EAST);
    325337        case NAUTICAL: return degreesMinutes(x) + ((x < 0) ? WEST : EAST);
    326338        case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().east());
  • trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java

    r11745 r12561  
    104104        assertNotNull(latlon);
    105105        DecimalFormat f = new DecimalFormat("00.0");
    106         assertEquals("51°46'"+f.format(43.0)+"\"", LatLon.dms(latlon.lat()));
    107         assertEquals("8°21'"+f.format(56.3)+"\"", LatLon.dms(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()));
    108108    }
    109109
Note: See TracChangeset for help on using the changeset viewer.