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

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

fixed texts, added EPSG codes to projection (to fix WMS access)

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