Last change
on this file since 5040 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:
716 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.projection.proj;
|
---|
3 |
|
---|
4 | import static java.lang.Math.*;
|
---|
5 |
|
---|
6 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Mercator Projection.
|
---|
10 | */
|
---|
11 | public class Mercator implements Proj {
|
---|
12 |
|
---|
13 | @Override
|
---|
14 | public String getName() {
|
---|
15 | return tr("Mercator");
|
---|
16 | }
|
---|
17 |
|
---|
18 | @Override
|
---|
19 | public String getProj4Id() {
|
---|
20 | return "merc";
|
---|
21 | }
|
---|
22 |
|
---|
23 | @Override
|
---|
24 | public double[] project(double lat_rad, double lon_rad) {
|
---|
25 | return new double[] { lon_rad, log(tan(PI/4 + lat_rad/2)) };
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | public double[] invproject(double east, double north) {
|
---|
30 | return new double[] { atan(sinh(north)), east };
|
---|
31 | }
|
---|
32 |
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.