001 // License: GPL. Copyright 2007 by Immanuel Scholz and others 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 * Classes implementing this are able to convert lat/lon values to 010 * planar screen coordinates. 011 * 012 * @author imi 013 */ 014 public interface Projection { 015 /** 016 * The default scale factor in east/north units per pixel ({@link #NavigatableComponent#scale})) 017 * FIXME: misnomer 018 */ 019 double getDefaultZoomInPPD(); 020 021 /** 022 * Convert from lat/lon to northing/easting. 023 * 024 * @param p The geo point to convert. x/y members of the point are filled. 025 */ 026 EastNorth latlon2eastNorth(LatLon p); 027 028 /** 029 * Convert from norting/easting to lat/lon. 030 * 031 * @param p The geo point to convert. lat/lon members of the point are filled. 032 */ 033 LatLon eastNorth2latlon(EastNorth p); 034 035 /** 036 * Describe the projection converter in one or two words. 037 */ 038 String toString(); 039 040 /** 041 * Return projection code. This should be a unique identifier. 042 * If projection supports parameters, return a different code 043 * for each set of parameters. 044 * 045 * The EPSG code can be used (if defined for the projection). 046 */ 047 String toCode(); 048 049 /** 050 * Get a filename compatible string (for the cache directory) 051 */ 052 String getCacheDirectoryName(); 053 054 /** 055 * Get the bounds of the world 056 */ 057 Bounds getWorldBoundsLatLon(); 058 }