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

Last change on this file since 12795 was 12216, checked in by bastiK, 7 years ago

deprecate unused methods

  • Property svn:eol-style set to native
File size: 4.0 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 extends Projecting {
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 easting/norting to lat/lon.
27 *
28 * @param en the geographical point to convert (in projected coordinates)
29 * @return the corresponding lat/lon (WGS84)
30 */
31 LatLon eastNorth2latlon(EastNorth en);
32
33 /**
34 * Describe the projection in one or two words.
35 * @return the name / description
36 */
37 @Override
38 String toString();
39
40 /**
41 * Return projection code.
42 *
43 * This should be a unique identifier.
44 * If projection supports parameters, return a different code
45 * for each set of parameters.
46 *
47 * The EPSG code can be used (if defined for the projection).
48 *
49 * @return the projection identifier
50 */
51 String toCode();
52
53 /**
54 * Get a filename compatible string (for the cache directory).
55 * @return the cache directory name (base name)
56 * @deprecated unused - remove in 2017-07
57 */
58 @Deprecated
59 String getCacheDirectoryName();
60
61 /**
62 * Get the bounds of the world.
63 * @return the supported lat/lon rectangle for this projection
64 */
65 Bounds getWorldBoundsLatLon();
66
67 /**
68 * Get an approximate EastNorth box around the lat/lon world bounds.
69 *
70 * Note: The projection is only valid within the bounds returned by
71 * {@link #getWorldBoundsLatLon()}. The lat/lon bounds need not be a
72 * rectangular shape in east/north space. This method returns a box that
73 * contains this shape.
74 *
75 * @return EastNorth box around the lat/lon world bounds
76 */
77 ProjectionBounds getWorldBoundsBoxEastNorth();
78
79 /**
80 * Find lat/lon-box containing all the area of a given rectangle in
81 * east/north space.
82 *
83 * This is an approximate method. Points outside of the world should be ignored.
84 *
85 * @param pb the rectangle in projected space
86 * @return minimum lat/lon box, that when projected, covers <code>pb</code>
87 */
88 Bounds getLatLonBoundsBox(ProjectionBounds pb);
89
90 /**
91 * Get a box in east/north space of this projection, that fully contains an
92 * east/north box of another projection.
93 *
94 * Reprojecting a rectangular box from one projection to another may distort/rotate
95 * the shape of the box, so in general one needs to walk along the boundary
96 * in small steps to get a reliable result.
97 *
98 * This is an approximate method.
99 *
100 * @param box the east/north box given in projection <code>boxProjection</code>
101 * @param boxProjection the projection of <code>box</code>
102 * @return an east/north box in this projection, containing the given box
103 */
104 ProjectionBounds getEastNorthBoundsBox(ProjectionBounds box, Projection boxProjection);
105
106 /**
107 * Get the number of meters per unit of this projection. This more
108 * defines the scale of the map, than real conversion of unit to meters
109 * as this value is more less correct only along certain lines of true scale.
110 *
111 * Used by WMTS to properly scale tiles
112 * @return meters per unit of projection
113 */
114 double getMetersPerUnit();
115
116 /**
117 * Does this projection natural order of coordinates is North East,
118 * instead of East North
119 *
120 * @return true if natural order of coordinates is North East, false if East North
121 */
122 boolean switchXY();
123}
Note: See TracBrowser for help on using the repository browser.