001    // License: GPL. For details, see LICENSE file.
002    package org.openstreetmap.josm.data.projection.datum;
003    
004    import org.openstreetmap.josm.data.coor.LatLon;
005    import org.openstreetmap.josm.data.projection.Ellipsoid;
006    
007    /**
008     * A datum with different ellipsoid than WGS84, but does not require
009     * shift, rotation or scaling.
010     */
011    public class CentricDatum extends AbstractDatum {
012    
013        public CentricDatum(String name, String proj4Id, Ellipsoid ellps) {
014            super(name, proj4Id, ellps);
015        }
016    
017        @Override
018        public LatLon toWGS84(LatLon ll) {
019            return Ellipsoid.WGS84.cart2LatLon(ellps.latLon2Cart(ll));
020        }
021    
022        @Override
023        public LatLon fromWGS84(LatLon ll) {
024            return this.ellps.cart2LatLon(Ellipsoid.WGS84.latLon2Cart(ll));
025        }
026    
027        @Override
028        public String toString() {
029            return "CentricDatum{ellipsoid="+ellps+"}";
030        }
031    }