001    // License: GPL. For details, see LICENSE file.
002    package org.openstreetmap.josm.data.projection;
003    
004    import org.openstreetmap.josm.data.Bounds;
005    import org.openstreetmap.josm.data.coor.EastNorth;
006    import org.openstreetmap.josm.data.coor.LatLon;
007    
008    /**
009     * A projection, i.e. a class that supports conversion from lat/lon
010     * to east/north and back.
011     *
012     * The conversion from east/north to the screen coordinates is simply a scale
013     * factor and x/y offset.
014     */
015    public interface Projection {
016        /**
017         * The default scale factor in east/north units per pixel ({@link #NavigatableComponent#scale})).
018         * FIXME: misnomer
019         * @return the scale factor
020         */
021        double getDefaultZoomInPPD();
022    
023        /**
024         * Convert from lat/lon to easting/northing.
025         *
026         * @param ll the geographical point to convert (in WGS84 lat/lon)
027         * @return the corresponding east/north coordinates
028         */
029        EastNorth latlon2eastNorth(LatLon ll);
030    
031        /**
032         * Convert from easting/norting to lat/lon.
033         *
034         * @param en the geographical point to convert (in projected coordinates)
035         * @return the corresponding lat/lon (WGS84)
036         */
037        LatLon eastNorth2latlon(EastNorth en);
038    
039        /**
040         * Describe the projection in one or two words.
041         * @return the name / description
042         */
043        String toString();
044    
045        /**
046         * Return projection code.
047         *
048         * This should be a unique identifier.
049         * If projection supports parameters, return a different code
050         * for each set of parameters.
051         * 
052         * The EPSG code can be used (if defined for the projection).
053         *
054         * @return the projection identifier
055         */
056        String toCode();
057    
058        /**
059         * Get a filename compatible string (for the cache directory).
060         * @return the cache directory name (base name)
061         */
062        String getCacheDirectoryName();
063    
064        /**
065         * Get the bounds of the world.
066         * @return the supported lat/lon rectangle for this projection
067         */
068        Bounds getWorldBoundsLatLon();
069    }