Changeset 864 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-08-24T21:14:42+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
r810 r864 66 66 public static int layoutZone = -1; 67 67 68 private static int currentZone = 0; 69 70 private static boolean dontDisplayErrors = false; 71 68 72 /** 69 73 * @param p WGS84 lat/lon (ellipsoid GRS80) (in degree) … … 77 81 78 82 // check if longitude and latitude are inside the french Lambert zones 79 intcurrentZone = 0;83 currentZone = 0; 80 84 boolean outOfLambertZones = false; 81 85 if (lt >= zoneLimits[3] && lt <= cMaxLatZone1 && lg >= cMinLonZones && lg <= cMaxLonZones) { … … 100 104 } else { 101 105 outOfLambertZones = true; // possible when MAX_LAT is used 106 if (p.lat() != 0 && Math.abs(p.lat()) != Projection.MAX_LAT 107 && p.lon() != 0 && Math.abs(p.lon()) != Projection.MAX_LON 108 && dontDisplayErrors == false) { 109 JOptionPane.showMessageDialog(Main.parent, 110 tr("The projection \"" + this.toString() + "\" is designed for\n" 111 + "latitudes between 46.1 and 57 degrees only.\n" 112 + "Use another projection system if you are not using\n" 113 + "a french WMS server.\n" 114 + "Do not upload any data after this message.")); 115 dontDisplayErrors = true; 116 } 102 117 } 103 118 if (!outOfLambertZones) { 104 if (layoutZone == -1) 119 if (layoutZone == -1) { 105 120 layoutZone = currentZone; 106 else if (layoutZone != currentZone) { 121 dontDisplayErrors = false; 122 } else if (layoutZone != currentZone) { 107 123 if ((currentZone < layoutZone && Math.abs(zoneLimits[currentZone] - lt) > cMaxOverlappingZones) 108 124 || (currentZone > layoutZone && Math.abs(zoneLimits[layoutZone] - lt) > cMaxOverlappingZones)) { … … 110 126 tr("IMPORTANT : data positionned far away from\n" 111 127 + "the current Lambert zone limits.\n" 128 + "Do not upload any data after this message.\n" 112 129 + "Undo your last action, Save your work \n" 113 130 + "and Start a new layer on the new zone.")); 114 131 layoutZone = -1; 132 dontDisplayErrors = true; 115 133 } else { 116 System.out.println("temporarily extends Lambert zone " 117 + layoutZone + " projection at lat,lon:" + lt + "," 118 + lg); 134 System.out.println("temporarily extends Lambert zone " + layoutZone + " projection at lat,lon:" 135 + lt + "," + lg); 119 136 } 120 137 } … … 127 144 128 145 public LatLon eastNorth2latlon(EastNorth p) { 129 LatLon geo = Geographic(p, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]); 146 LatLon geo; 147 if (layoutZone == -1) 148 // possible until the Lambert zone is determined by latlon2eastNorth() with a valid LatLon 149 geo = Geographic(p, Xs[currentZone], Ys[currentZone], c[currentZone], n[currentZone]); 150 else 151 geo = Geographic(p, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]); 130 152 // translate ellipsoid Clark => GRS80 (WGS83) 131 153 LatLon wgs = Clark2GRS80(geo); … … 133 155 } 134 156 135 @Override 136 public String toString() { 137 return "Lambert"; 157 @Override public String toString() { 158 return "Lambert Zone (France)"; 138 159 } 139 160
Note:
See TracChangeset
for help on using the changeset viewer.