Last change
on this file since 4289 was 4285, checked in by bastiK, 13 years ago |
major projection rework
More modular structure, inspired by Proj.4.
There are almost no semantic changes to the projection algorithms. Mostly factors of 'a' and 180/PI have been moved from one place to the other. In UTM_France_DOM, the ellipsoid conversion for the first 3 projections has been changed from hayford <-> GRS80 to hayford <-> WGS84.
Some redundant algorithms have been removed. In particular:
- UTM_France_DOM used to have its own Transverse Mercator implementation. It is different from the implementation in TransverseMercator.java as it has another series expansion. For EPSG::2975, there are numeric differences on centimeter scale. However, the new data fits better with Proj.4 output.
- Also removed are alternate implementations of LambertConformalConic. (They are all quite similar, though.)
|
-
Property svn:eol-style
set to
native
|
File size:
1.4 KB
|
Rev | Line | |
---|
[298] | 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
[36] | 2 | package org.openstreetmap.josm.data.projection;
|
---|
| 3 |
|
---|
[1032] | 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
| 5 |
|
---|
[2017] | 6 | import org.openstreetmap.josm.data.Bounds;
|
---|
[71] | 7 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
[4285] | 8 | import org.openstreetmap.josm.data.projection.datum.WGS84Datum;
|
---|
[36] | 9 |
|
---|
| 10 | /**
|
---|
[4285] | 11 | * Mercator Projection
|
---|
[1169] | 12 | *
|
---|
| 13 | * The center of the mercator projection is always the 0 grad
|
---|
[36] | 14 | * coordinate.
|
---|
[1169] | 15 | *
|
---|
[1261] | 16 | * See also USGS Bulletin 1532
|
---|
| 17 | * (http://egsc.usgs.gov/isb/pubs/factsheets/fs08799.html)
|
---|
| 18 | *
|
---|
[36] | 19 | * @author imi
|
---|
| 20 | */
|
---|
[4285] | 21 | public class Mercator extends AbstractProjection {
|
---|
[36] | 22 |
|
---|
[4285] | 23 | public Mercator() {
|
---|
| 24 | ellps = Ellipsoid.WGS84;
|
---|
| 25 | datum = WGS84Datum.INSTANCE;
|
---|
| 26 | proj = new org.openstreetmap.josm.data.projection.proj.Mercator();
|
---|
[1169] | 27 | }
|
---|
[36] | 28 |
|
---|
[4285] | 29 | @Override
|
---|
| 30 | public String toString() {
|
---|
[1169] | 31 | return tr("Mercator");
|
---|
| 32 | }
|
---|
[79] | 33 |
|
---|
[4285] | 34 | @Override
|
---|
| 35 | public Integer getEpsgCode() {
|
---|
| 36 | /* initially they used 3785 but that has been superseded,
|
---|
| 37 | * see http://www.epsg-registry.org/ */
|
---|
| 38 | return 3857;
|
---|
[1309] | 39 | }
|
---|
| 40 |
|
---|
[2516] | 41 | @Override
|
---|
| 42 | public int hashCode() {
|
---|
| 43 | return getClass().getName().hashCode(); // we have no variables
|
---|
| 44 | }
|
---|
| 45 |
|
---|
[4285] | 46 | @Override
|
---|
[79] | 47 | public String getCacheDirectoryName() {
|
---|
| 48 | return "mercator";
|
---|
| 49 | }
|
---|
[116] | 50 |
|
---|
[4285] | 51 | @Override
|
---|
[1722] | 52 | public Bounds getWorldBoundsLatLon()
|
---|
| 53 | {
|
---|
| 54 | return new Bounds(
|
---|
[2114] | 55 | new LatLon(-85.05112877980659, -180.0),
|
---|
| 56 | new LatLon(85.05112877980659, 180.0));
|
---|
[1722] | 57 | }
|
---|
[2114] | 58 |
|
---|
[36] | 59 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.