Last change
on this file since 6268 was 5072, checked in by bastiK, 12 years ago |
basic support for custom projections (see #7495)
|
-
Property svn:eol-style
set to
native
|
File size:
850 bytes
|
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 | */
|
---|
11 | public class CentricDatum extends AbstractDatum {
|
---|
12 |
|
---|
13 | public CentricDatum(String name, String proj4Id, Ellipsoid ellps) {
|
---|
14 | super(name, proj4Id, ellps);
|
---|
15 | }
|
---|
16 |
|
---|
17 | @Override
|
---|
18 | public LatLon toWGS84(LatLon ll) {
|
---|
19 | return Ellipsoid.WGS84.cart2LatLon(ellps.latLon2Cart(ll));
|
---|
20 | }
|
---|
21 |
|
---|
22 | @Override
|
---|
23 | public LatLon fromWGS84(LatLon ll) {
|
---|
24 | return this.ellps.cart2LatLon(Ellipsoid.WGS84.latLon2Cart(ll));
|
---|
25 | }
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public String toString() {
|
---|
29 | return "CentricDatum{ellipsoid="+ellps+"}";
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.