Changeset 1743 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-07-07T19:54:54+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/UTM.java
r1724 r1743 91 91 { 92 92 return Math.toRadians(-183.0 + (zone * 6.0)); 93 } 94 private double UTMCentralMeridianDeg(int zone) 95 { 96 return -183.0 + (zone * 6.0); 93 97 } 94 98 … … 324 328 325 329 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())); 327 331 return new EastNorth(a.east() * UTMScaleFactor + 3500000.0, a.north() * UTMScaleFactor); 328 332 } 329 333 330 334 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()); 332 340 } 333 341 334 342 /* 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; 337 346 } 338 347 … … 354 363 { 355 364 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)); 358 367 } 359 368 }
Note:
See TracChangeset
for help on using the changeset viewer.