Ignore:
Timestamp:
2012-05-12T23:27:39+02:00 (8 years ago)
Author:
bastiK
Message:
  • removed offset option from UTM which is probably rarely used. (custom projection can be used for this now, e.g. +proj=tmerc +lon_0=-3 +k_0=0.9996 +x_0=3500000 or +init=epsg:32630 +x_0=3500000)
  • fixed tests
Location:
trunk/src/org/openstreetmap/josm/data/projection
Files:
5 edited

Legend:

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

    r5235 r5236  
    9696
    9797    public Lambert(final int layoutZone) {
     98        if (layoutZone < 0 || layoutZone >= 4)
     99            throw new IllegalArgumentException();
    98100        this.layoutZone = layoutZone;
    99101        ellps = Ellipsoid.clarkeIGN;
  • trunk/src/org/openstreetmap/josm/data/projection/ProjectionInfo.java

    r5234 r5236  
    44import java.util.Collection;
    55import java.util.HashMap;
     6import java.util.Map;
    67
    78import org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice;
     
    910
    1011public class ProjectionInfo {
    11     private static HashMap<String, ProjectionChoice> allCodesPC;
    12     private static HashMap<String, Projection> allCodes;
     12    private static Map<String, ProjectionChoice> allCodesPC = new HashMap<String, ProjectionChoice>();
     13    private static Map<String, Projection> allCodes = new HashMap<String, Projection>();
    1314
    1415    static {
    15         allCodes = new HashMap<String, Projection>();
    1616        for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) {
    1717            for (String code : pc.allCodes()) {
  • trunk/src/org/openstreetmap/josm/data/projection/Puwg.java

    r5235 r5236  
    2222    private final int zone;
    2323
    24     static public PuwgData[] Zones = new PuwgData[] {
     24    static public PuwgData[] zones = new PuwgData[] {
    2525        new Epsg2180(),
    2626        new Epsg2176(),
     
    3535
    3636    public Puwg(int zone) {
     37        if (zone < 0 || zone >= zones.length)
     38            throw new IllegalArgumentException();
    3739        ellps = Ellipsoid.GRS80;
    3840        proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator();
     
    4446        datum = GRS80Datum.INSTANCE;
    4547        this.zone = zone;
    46         PuwgData z = Zones[zone];
     48        PuwgData z = zones[zone];
    4749        x_0 = z.getPuwgFalseEasting();
    4850        y_0 = z.getPuwgFalseNorthing();
     
    5860    @Override
    5961    public Integer getEpsgCode() {
    60         return Zones[zone].getEpsgCode();
     62        return zones[zone].getEpsgCode();
    6163    }
    6264
     
    6870    @Override
    6971    public String getCacheDirectoryName() {
    70         return Zones[zone].getCacheDirectoryName();
     72        return zones[zone].getCacheDirectoryName();
    7173    }
    7274
    7375    @Override
    7476    public Bounds getWorldBoundsLatLon() {
    75         return Zones[zone].getWorldBoundsLatLon();
     77        return zones[zone].getWorldBoundsLatLon();
    7678    }
    7779
  • trunk/src/org/openstreetmap/josm/data/projection/UTM.java

    r5235 r5236  
    2424    private Hemisphere hemisphere;
    2525
    26     /**
    27      * Applies an additional false easting of 3000000 m if true.
    28      */
    29     private boolean offset;
    30 
    3126    public UTM() {
    32         this(DEFAULT_ZONE, DEFAULT_HEMISPHERE, false);
     27        this(DEFAULT_ZONE, DEFAULT_HEMISPHERE);
    3328    }
    3429
    35     public UTM(int zone, Hemisphere hemisphere, boolean offset) {
     30    public UTM(int zone, Hemisphere hemisphere) {
     31        if (zone < 1 || zone > 60)
     32            throw new IllegalArgumentException();
    3633        ellps = Ellipsoid.WGS84;
    3734        proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator();
     
    4441        this.zone = zone;
    4542        this.hemisphere = hemisphere;
    46         this.offset = offset;
    47         x_0 = 500000 + (offset ? 3000000 : 0);
     43        x_0 = 500000;
    4844        y_0 = hemisphere == Hemisphere.North ? 0 : 10000000;
    4945        lon_0 = getUtmCentralMeridianDeg(zone);
     
    8177    @Override
    8278    public Integer getEpsgCode() {
    83         return ((offset?325800:32600) + getzone() + (hemisphere == Hemisphere.South?100:0));
     79        return (32600 + getzone() + (hemisphere == Hemisphere.South?100:0));
    8480    }
    8581
  • trunk/src/org/openstreetmap/josm/data/projection/UTM_France_DOM.java

    r5235 r5236  
    6161
    6262    public UTM_France_DOM(int currentGeodesic) {
     63        if (currentGeodesic < 0 || currentGeodesic >= 5)
     64            throw new IllegalArgumentException();
    6365        this.currentGeodesic = currentGeodesic;
    6466        datum = utmDatums[currentGeodesic];
Note: See TracChangeset for help on using the changeset viewer.