Changeset 3232 in josm for trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
- Timestamp:
- 11.05.2010 09:25:21 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
r3083 r3232 123 123 public Collection<String> getPreferencesFromCode(String code) 124 124 { 125 for (P rojectionp : Puwg.Zones)125 for (PuwgData p : Puwg.Zones) 126 126 { 127 127 if(code.equals(p.toCode())) … … 151 151 } 152 152 153 interface PuwgData extends Projection { 154 public double getPuwgCentralMeridianDeg(); 155 public double getPuwgCentralMeridian(); 156 public double getPuwgFalseEasting(); 157 public double getPuwgFalseNorthing(); 158 public double getPuwgScaleFactor(); 153 interface PuwgData { 154 double getPuwgCentralMeridianDeg(); 155 double getPuwgCentralMeridian(); 156 double getPuwgFalseEasting(); 157 double getPuwgFalseNorthing(); 158 double getPuwgScaleFactor(); 159 160 // Projection methods 161 String toCode(); 162 String getCacheDirectoryName(); 163 Bounds getWorldBoundsLatLon(); 159 164 } 160 165 … … 165 170 private static final double Epsg2180ScaleFactor = 0.9993; 166 171 private static final double Epsg2180CentralMeridian = 19.0; 167 private static DecimalFormat decFormatter = new DecimalFormat("###0");168 172 169 173 @Override public String toString() { … … 185 189 new LatLon(54.84, 24.15)); 186 190 } 187 188 /* These two MUST NOT be used. Use Puwg implementation instead. */189 public EastNorth latlon2eastNorth(LatLon p) { return null; }190 public LatLon eastNorth2latlon(EastNorth p) { return null; }191 191 192 192 public double getPuwgCentralMeridianDeg() { return Epsg2180CentralMeridian; } … … 195 195 public double getPuwgFalseNorthing() { return Epsg2180FalseNorthing; } 196 196 public double getPuwgScaleFactor() { return Epsg2180ScaleFactor; } 197 198 public double getDefaultZoomInPPD() {199 // This will set the scale bar to about 100 km200 return 0.009;201 }202 203 public String eastToString(EastNorth p) {204 return decFormatter.format(p.east());205 }206 207 public String northToString(EastNorth p) {208 return decFormatter.format(p.north());209 }210 197 } 211 198 … … 218 205 final private String[] Puwg2000Code = { "EPSG:2176", "EPSG:2177", "EPSG:2178", "EPSG:2179"}; 219 206 final private String[] Puwg2000CDName = { "epsg2176", "epsg2177", "epsg2178", "epsg2179"}; 220 private static DecimalFormat decFormatter = new DecimalFormat("###0.00");221 207 222 208 @Override public String toString() { … … 238 224 new LatLon(54.84, (3 * getZone()) + 1.5)); 239 225 } 240 241 /* These two MUST NOT be used. Use Puwg implementation instead. */242 public EastNorth latlon2eastNorth(LatLon p) { return null; }243 public LatLon eastNorth2latlon(EastNorth p) { return null; }244 226 245 227 public double getPuwgCentralMeridianDeg() { return getZone() * 3.0; } … … 252 234 public int getZoneIndex() { return getZone() - 5; } 253 235 254 public double getDefaultZoomInPPD() { 255 // This will set the scale bar to about 100 km 256 return 0.009; 257 } 258 259 public String eastToString(EastNorth p) { 260 return Integer.toString(getZone()) + decFormatter.format(p.east()); 261 } 262 263 public String northToString(EastNorth p) { 264 return decFormatter.format(p.north()); 265 } 266 267 } 268 269 class Epsg2176 extends Puwg2000 implements Projection { 236 } 237 238 class Epsg2176 extends Puwg2000 { 270 239 private static final int PuwgZone = 5; 271 240 … … 274 243 } 275 244 276 class Epsg2177 extends Puwg2000 implements Projection{245 class Epsg2177 extends Puwg2000 { 277 246 private static final int PuwgZone = 6; 278 247 … … 281 250 } 282 251 283 class Epsg2178 extends Puwg2000 implements Projection{252 class Epsg2178 extends Puwg2000 { 284 253 private static final int PuwgZone = 7; 285 254 … … 288 257 } 289 258 290 class Epsg2179 extends Puwg2000 implements Projection{259 class Epsg2179 extends Puwg2000 { 291 260 private static final int PuwgZone = 8; 292 261
Note: See TracChangeset
for help on using the changeset viewer.
