Ignore:
Timestamp:
2009-08-23T22:37:39+02:00 (10 years ago)
Author:
Gubaer
Message:

fixed #3261: Use the "name:$CURRENT_LOCALE" name in the JOSM UI instead of "name" when it exists
new: new checkbox in LAF preferences for enabling/disabling localized names for primitives

Location:
trunk/src/org/openstreetmap/josm/data/coor
Files:
1 added
1 edited

Legend:

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

    r1789 r1990  
    2525    private static DecimalFormat cDdFormatter = new DecimalFormat("###0.0000");
    2626
    27     /**
    28      * Possible ways to display coordinates
    29      */
    30     public enum CoordinateFormat {
    31         DECIMAL_DEGREES {public String toString() {return tr("Decimal Degrees");}},
    32         DEGREES_MINUTES_SECONDS {public String toString() {return tr("Degrees Minutes Seconds");}};
    33     }
    3427
    3528    public static String dms(double pCoordinate) {
     
    4235
    4336        return tDegree + "\u00B0" + cDmsMinuteFormatter.format(tMinutes) + "\'"
    44             + cDmsSecondFormatter.format(tSeconds) + "\"";
     37        + cDmsSecondFormatter.format(tSeconds) + "\"";
    4538    }
    4639
     
    9487        Bounds b = Main.proj.getWorldBoundsLatLon();
    9588        return lat() < b.min.lat() || lat() > b.max.lat() ||
    96             lon() < b.min.lon() || lon() > b.max.lon();
     89        lon() < b.min.lon() || lon() > b.max.lon();
    9790    }
    9891
     
    112105    public double greatCircleDistance(LatLon other) {
    113106        return (Math.acos(
    114             Math.sin(Math.toRadians(lat())) * Math.sin(Math.toRadians(other.lat())) +
    115             Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) *
    116                           Math.cos(Math.toRadians(other.lon()-lon()))) * 6378135);
     107                Math.sin(Math.toRadians(lat())) * Math.sin(Math.toRadians(other.lat())) +
     108                Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) *
     109                Math.cos(Math.toRadians(other.lon()-lon()))) * 6378135);
    117110    }
    118111
     
    130123        } else {
    131124            rv = Math.atan((other.lon()-lon())/(other.lat()-lat()));
    132             if (rv < 0) rv += Math.PI;
    133             if (other.lon() < lon()) rv += Math.PI;
     125            if (rv < 0) {
     126                rv += Math.PI;
     127            }
     128            if (other.lon() < lon()) {
     129                rv += Math.PI;
     130            }
    134131        }
    135132        return rv;
     
    149146    public LatLon interpolate(LatLon ll2, double proportion) {
    150147        return new LatLon(this.lat() + proportion * (ll2.lat() - this.lat()),
    151             this.lon() + proportion * (ll2.lon() - this.lon()));
     148                this.lon() + proportion * (ll2.lon() - this.lon()));
    152149    }
    153150
Note: See TracChangeset for help on using the changeset viewer.