source: josm/trunk/src/org/openstreetmap/josm/data/projection/Epsg4326.java@ 1724

Last change on this file since 1724 was 1724, checked in by stoecker, 15 years ago

some more changes and bug fixes related to new projection stuff - GPX should now work also

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.data.projection;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import org.openstreetmap.josm.data.coor.LatLon;
7import org.openstreetmap.josm.data.coor.EastNorth;
8import org.openstreetmap.josm.data.Bounds;
9import org.openstreetmap.josm.data.ProjectionBounds;
10
11/**
12 * Directly use latitude / longitude values as x/y.
13 *
14 * @author imi
15 */
16public class Epsg4326 implements Projection {
17
18 public EastNorth latlon2eastNorth(LatLon p) {
19 return new EastNorth(p.lon(), p.lat());
20 }
21
22 public LatLon eastNorth2latlon(EastNorth p) {
23 return new LatLon(p.north(), p.east());
24 }
25
26 @Override public String toString() {
27 return tr("WGS84 Geographisch");
28 }
29
30 public String toCode() {
31 return "EPSG:4326";
32 }
33
34 public String getCacheDirectoryName() {
35 return "epsg4326";
36 }
37
38 public ProjectionBounds getWorldBounds()
39 {
40 Bounds b = getWorldBoundsLatLon();
41 return new ProjectionBounds(latlon2eastNorth(b.min), latlon2eastNorth(b.max));
42 }
43
44 public Bounds getWorldBoundsLatLon()
45 {
46 return new Bounds(
47 new LatLon(-90.0, -180.0),
48 new LatLon(90.0, 180.0));
49 }
50}
Note: See TracBrowser for help on using the repository browser.