Ignore:
Timestamp:
2009-07-07T19:54:54+02:00 (10 years ago)
Author:
stoecker
Message:

added much improved preferences for external styles and presets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/UTM.java

    r1724 r1743  
    9191    {
    9292        return Math.toRadians(-183.0 + (zone * 6.0));
     93    }
     94    private double UTMCentralMeridianDeg(int zone)
     95    {
     96        return -183.0 + (zone * 6.0);
    9397    }
    9498
     
    324328
    325329    public EastNorth latlon2eastNorth(LatLon p) {
    326         EastNorth a = MapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), UTMCentralMeridian(33));
     330        EastNorth a = MapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), UTMCentralMeridian(getzone()));
    327331        return new EastNorth(a.east() * UTMScaleFactor + 3500000.0, a.north() * UTMScaleFactor);
    328332    }
    329333
    330334    public LatLon eastNorth2latlon(EastNorth p) {
    331         return MapXYToLatLon((p.east()-3500000.0)/UTMScaleFactor, p.north()/UTMScaleFactor, UTMCentralMeridian(33));
     335        return MapXYToLatLon((p.east()-3500000.0)/UTMScaleFactor, p.north()/UTMScaleFactor, UTMCentralMeridian(getzone()));
     336    }
     337
     338    @Override public String toString() {
     339        return tr("UTM Zone {0}", getzone());
    332340    }
    333341
    334342    /* TODO - support all UTM's not only zone 33 */
    335     @Override public String toString() {
    336         return tr("UTM Zone {0}", 33);
     343    public int getzone()
     344    {
     345      return 33;
    337346    }
    338347
     
    354363    {
    355364        return new Bounds(
    356         new LatLon(-90.0, 14.0),
    357         new LatLon(90.0, 22.0));
     365        new LatLon(-85.0, UTMCentralMeridianDeg(getzone())-5.0),
     366        new LatLon(85.0, UTMCentralMeridianDeg(getzone())+5.0));
    358367    }
    359368}
Note: See TracChangeset for help on using the changeset viewer.