Changeset 5236 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2012-05-12T23:27:39+02:00 (12 years ago)
- 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 96 96 97 97 public Lambert(final int layoutZone) { 98 if (layoutZone < 0 || layoutZone >= 4) 99 throw new IllegalArgumentException(); 98 100 this.layoutZone = layoutZone; 99 101 ellps = Ellipsoid.clarkeIGN; -
trunk/src/org/openstreetmap/josm/data/projection/ProjectionInfo.java
r5234 r5236 4 4 import java.util.Collection; 5 5 import java.util.HashMap; 6 import java.util.Map; 6 7 7 8 import org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice; … … 9 10 10 11 public 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>(); 13 14 14 15 static { 15 allCodes = new HashMap<String, Projection>();16 16 for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) { 17 17 for (String code : pc.allCodes()) { -
trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
r5235 r5236 22 22 private final int zone; 23 23 24 static public PuwgData[] Zones = new PuwgData[] {24 static public PuwgData[] zones = new PuwgData[] { 25 25 new Epsg2180(), 26 26 new Epsg2176(), … … 35 35 36 36 public Puwg(int zone) { 37 if (zone < 0 || zone >= zones.length) 38 throw new IllegalArgumentException(); 37 39 ellps = Ellipsoid.GRS80; 38 40 proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator(); … … 44 46 datum = GRS80Datum.INSTANCE; 45 47 this.zone = zone; 46 PuwgData z = Zones[zone];48 PuwgData z = zones[zone]; 47 49 x_0 = z.getPuwgFalseEasting(); 48 50 y_0 = z.getPuwgFalseNorthing(); … … 58 60 @Override 59 61 public Integer getEpsgCode() { 60 return Zones[zone].getEpsgCode();62 return zones[zone].getEpsgCode(); 61 63 } 62 64 … … 68 70 @Override 69 71 public String getCacheDirectoryName() { 70 return Zones[zone].getCacheDirectoryName();72 return zones[zone].getCacheDirectoryName(); 71 73 } 72 74 73 75 @Override 74 76 public Bounds getWorldBoundsLatLon() { 75 return Zones[zone].getWorldBoundsLatLon();77 return zones[zone].getWorldBoundsLatLon(); 76 78 } 77 79 -
trunk/src/org/openstreetmap/josm/data/projection/UTM.java
r5235 r5236 24 24 private Hemisphere hemisphere; 25 25 26 /**27 * Applies an additional false easting of 3000000 m if true.28 */29 private boolean offset;30 31 26 public UTM() { 32 this(DEFAULT_ZONE, DEFAULT_HEMISPHERE , false);27 this(DEFAULT_ZONE, DEFAULT_HEMISPHERE); 33 28 } 34 29 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(); 36 33 ellps = Ellipsoid.WGS84; 37 34 proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator(); … … 44 41 this.zone = zone; 45 42 this.hemisphere = hemisphere; 46 this.offset = offset; 47 x_0 = 500000 + (offset ? 3000000 : 0); 43 x_0 = 500000; 48 44 y_0 = hemisphere == Hemisphere.North ? 0 : 10000000; 49 45 lon_0 = getUtmCentralMeridianDeg(zone); … … 81 77 @Override 82 78 public Integer getEpsgCode() { 83 return ( (offset?325800:32600)+ getzone() + (hemisphere == Hemisphere.South?100:0));79 return (32600 + getzone() + (hemisphere == Hemisphere.South?100:0)); 84 80 } 85 81 -
trunk/src/org/openstreetmap/josm/data/projection/UTM_France_DOM.java
r5235 r5236 61 61 62 62 public UTM_France_DOM(int currentGeodesic) { 63 if (currentGeodesic < 0 || currentGeodesic >= 5) 64 throw new IllegalArgumentException(); 63 65 this.currentGeodesic = currentGeodesic; 64 66 datum = utmDatums[currentGeodesic];
Note:
See TracChangeset
for help on using the changeset viewer.