001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.projection.datum;
003
004import org.openstreetmap.josm.data.coor.LatLon;
005import org.openstreetmap.josm.data.projection.Ellipsoid;
006
007/**
008 * Represents a geodetic datum.
009 *
010 * Basically it provides conversion functions from and to the WGS84 datum.
011 * @since 4285
012 */
013public interface Datum {
014
015    /**
016     * Returns a human readable name of this projection.
017     * @return a human readable name of this projection
018     */
019    String getName();
020
021    /**
022     * Replies the Proj.4 identifier.
023     * @return the Proj.4 identifier (as reported by cs2cs -ld)
024     * If no id exists, return null.
025     */
026    String getProj4Id();
027
028    /**
029     * Returns the ellipsoid associated with this datum.
030     * @return the ellipsoid associated with this datum
031     */
032    Ellipsoid getEllipsoid();
033
034    /**
035     * Convert lat/lon from this datum to {@link Ellipsoid#WGS84} datum.
036     * @param ll original lat/lon in this datum
037     * @return lat/lon converted to WGS84
038     */
039    LatLon toWGS84(LatLon ll);
040
041    /**
042     * Convert lat/lon from {@link Ellipsoid#WGS84} to this datum.
043     * @param ll original lat/lon in WGS84
044     * @return converted lat/lon in this datum
045     */
046    LatLon fromWGS84(LatLon ll);
047}