1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.data.projection;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.coor.EastNorth;
|
---|
5 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
6 | import org.openstreetmap.josm.data.Bounds;
|
---|
7 | import org.openstreetmap.josm.data.ProjectionBounds;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Classes implementing this are able to convert lat/lon values to
|
---|
11 | * planar screen coordinates.
|
---|
12 | *
|
---|
13 | * @author imi
|
---|
14 | */
|
---|
15 | public interface Projection {
|
---|
16 | /**
|
---|
17 | * Minimum difference in location to not be represented as the same position.
|
---|
18 | */
|
---|
19 | public static final double MAX_SERVER_PRECISION = 1e12;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * List of all available projections.
|
---|
23 | */
|
---|
24 | public static Projection[] allProjections = new Projection[]{
|
---|
25 | new Epsg4326(),
|
---|
26 | new Mercator(),
|
---|
27 | new Lambert(),
|
---|
28 | new LambertEST(),
|
---|
29 | new SwissGrid(),
|
---|
30 | new UTM()
|
---|
31 | };
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Convert from lat/lon to northing/easting.
|
---|
35 | *
|
---|
36 | * @param p The geo point to convert. x/y members of the point are filled.
|
---|
37 | */
|
---|
38 | EastNorth latlon2eastNorth(LatLon p);
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Convert from norting/easting to lat/lon.
|
---|
42 | *
|
---|
43 | * @param p The geo point to convert. lat/lon members of the point are filled.
|
---|
44 | */
|
---|
45 | LatLon eastNorth2latlon(EastNorth p);
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Describe the projection converter in one or two words.
|
---|
49 | */
|
---|
50 | String toString();
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Return projection code.
|
---|
54 | */
|
---|
55 | String toCode();
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Get a filename compatible string (for the cache directory)
|
---|
59 | */
|
---|
60 | String getCacheDirectoryName();
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Get the bounds of the world
|
---|
64 | */
|
---|
65 | Bounds getWorldBoundsLatLon();
|
---|
66 | }
|
---|