source: josm/trunk/src/org/openstreetmap/josm/data/projection/Projection.java@ 10680

Last change on this file since 10680 was 10381, checked in by Don-vip, 8 years ago

see #12959 - fix javadoc warning

  • Property svn:eol-style set to native
File size: 3.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection;
3
4import org.openstreetmap.josm.data.Bounds;
5import org.openstreetmap.josm.data.ProjectionBounds;
6import org.openstreetmap.josm.data.coor.EastNorth;
7import org.openstreetmap.josm.data.coor.LatLon;
8
9/**
10 * A projection, i.e. a class that supports conversion from lat/lon
11 * to east/north and back.
12 *
13 * The conversion from east/north to the screen coordinates is simply a scale
14 * factor and x/y offset.
15 */
16public interface Projection {
17 /**
18 * The default scale factor in east/north units per pixel
19 * ({@link org.openstreetmap.josm.gui.NavigatableComponent#getState})).
20 * FIXME: misnomer
21 * @return the scale factor
22 */
23 double getDefaultZoomInPPD();
24
25 /**
26 * Convert from lat/lon to easting/northing.
27 *
28 * @param ll the geographical point to convert (in WGS84 lat/lon)
29 * @return the corresponding east/north coordinates
30 */
31 EastNorth latlon2eastNorth(LatLon ll);
32
33 /**
34 * Convert from easting/norting to lat/lon.
35 *
36 * @param en the geographical point to convert (in projected coordinates)
37 * @return the corresponding lat/lon (WGS84)
38 */
39 LatLon eastNorth2latlon(EastNorth en);
40
41 /**
42 * Describe the projection in one or two words.
43 * @return the name / description
44 */
45 @Override
46 String toString();
47
48 /**
49 * Return projection code.
50 *
51 * This should be a unique identifier.
52 * If projection supports parameters, return a different code
53 * for each set of parameters.
54 *
55 * The EPSG code can be used (if defined for the projection).
56 *
57 * @return the projection identifier
58 */
59 String toCode();
60
61 /**
62 * Get a filename compatible string (for the cache directory).
63 * @return the cache directory name (base name)
64 */
65 String getCacheDirectoryName();
66
67 /**
68 * Get the bounds of the world.
69 * @return the supported lat/lon rectangle for this projection
70 */
71 Bounds getWorldBoundsLatLon();
72
73 /**
74 * Get an approximate EastNorth box around the lat/lon world bounds.
75 *
76 * Note: The projection is only valid within the bounds returned by
77 * {@link #getWorldBoundsLatLon()}. The lat/lon bounds need not be a
78 * rectangular shape in east/north space. This method returns a box that
79 * contains this shape.
80 *
81 * @return EastNorth box around the lat/lon world bounds
82 */
83 ProjectionBounds getWorldBoundsBoxEastNorth();
84
85 /**
86 * Find lat/lon-box containing all the area of a given rectangle in
87 * east/north space.
88 *
89 * This is an approximate method. Points outside of the world should be ignored.
90 *
91 * @param pb the rectangle in projected space
92 * @return minimum lat/lon box, that when projected, covers <code>pb</code>
93 */
94 Bounds getLatLonBoundsBox(ProjectionBounds pb);
95
96 /**
97 * Get the number of meters per unit of this projection. This more
98 * defines the scale of the map, than real conversion of unit to meters
99 * as this value is more less correct only along certain lines of true scale.
100 *
101 * Used by WMTS to properly scale tiles
102 * @return meters per unit of projection
103 */
104 double getMetersPerUnit();
105
106 /**
107 * Does this projection natural order of coordinates is North East,
108 * instead of East North
109 *
110 * @return true if natural order of coordinates is North East, false if East North
111 */
112 boolean switchXY();
113}
Note: See TracBrowser for help on using the repository browser.