Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.projection.datum;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
5 | import org.openstreetmap.josm.data.projection.Ellipsoid;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * A datum with different ellipsoid than WGS84, but does not require
|
---|
9 | * shift, rotation or scaling.
|
---|
10 | * @since 4285
|
---|
11 | */
|
---|
12 | public class CentricDatum extends AbstractDatum {
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Constructs a new {@code CentricDatum}.
|
---|
16 | * @param name Datum name
|
---|
17 | * @param proj4Id proj.4 identifier
|
---|
18 | * @param ellps Ellipsoid. Must be non-null and different from WGS84
|
---|
19 | */
|
---|
20 | public CentricDatum(String name, String proj4Id, Ellipsoid ellps) {
|
---|
21 | super(name, proj4Id, ellps);
|
---|
22 | }
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public LatLon toWGS84(LatLon ll) {
|
---|
26 | return Ellipsoid.WGS84.cart2LatLon(ellps.latLon2Cart(ll));
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public LatLon fromWGS84(LatLon ll) {
|
---|
31 | return this.ellps.cart2LatLon(Ellipsoid.WGS84.latLon2Cart(ll));
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | public String toString() {
|
---|
36 | return "CentricDatum{ellipsoid="+ellps+'}';
|
---|
37 | }
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.