| Revision 5235,
1.3 KB
checked in by bastiK, 9 days ago
(diff) |
|
no rounding for projection bounds, to avoid 42 being dispayed as 41.99999999999
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others |
|---|
| 2 | package org.openstreetmap.josm.data.projection; |
|---|
| 3 | |
|---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr; |
|---|
| 5 | |
|---|
| 6 | import org.openstreetmap.josm.data.Bounds; |
|---|
| 7 | import org.openstreetmap.josm.data.coor.EastNorth; |
|---|
| 8 | import org.openstreetmap.josm.data.coor.LatLon; |
|---|
| 9 | |
|---|
| 10 | /** |
|---|
| 11 | * Directly use latitude / longitude values as x/y. |
|---|
| 12 | * |
|---|
| 13 | * @author imi |
|---|
| 14 | */ |
|---|
| 15 | public class Epsg4326 implements Projection { |
|---|
| 16 | |
|---|
| 17 | public EastNorth latlon2eastNorth(LatLon p) { |
|---|
| 18 | return new EastNorth(p.lon(), p.lat()); |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | public LatLon eastNorth2latlon(EastNorth p) { |
|---|
| 22 | return new LatLon(p.north(), p.east()); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | @Override public String toString() { |
|---|
| 26 | return tr("WGS84 Geographic"); |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | public String toCode() { |
|---|
| 30 | return "EPSG:4326"; |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | @Override |
|---|
| 34 | public int hashCode() { |
|---|
| 35 | return getClass().getName().hashCode(); // we have no variables |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | public String getCacheDirectoryName() { |
|---|
| 39 | return "epsg4326"; |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | public Bounds getWorldBoundsLatLon() |
|---|
| 43 | { |
|---|
| 44 | return new Bounds( |
|---|
| 45 | new LatLon(-90.0, -180.0), |
|---|
| 46 | new LatLon(90.0, 180.0), false); |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | public double getDefaultZoomInPPD() { |
|---|
| 50 | // This will set the scale bar to about 100 km |
|---|
| 51 | return 0.009; |
|---|
| 52 | } |
|---|
| 53 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.