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

Last change on this file since 1805 was 1722, checked in by stoecker, 15 years ago

Large rework in projection handling - now allows only switching and more specific projections
TODO:

  • allow subprojections (i.e. settings for projections)
  • setup preferences for subprojections
  • better support of the new projection depending world bounds (how to handle valid data outside of world)
  • do not allow to zoom out of the world - zoom should stop when whole world is displayed
  • fix Lambert and SwissGrid to handle new OutOfWorld style and subprojections
  • fix new UTM projection
  • handle layers with fixed projection on projection change
  • allow easier projection switching (e.g. in menu)

NOTE:
This checkin very likely will cause problems. Please report or fix them. Older plugins may have trouble. The SVN plugins
have been fixed but may have problems nevertheless. This is a BIG change, but will make JOSMs internal structure much cleaner
and reduce lots of projection related problems.

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.data.projection;
3
4import org.openstreetmap.josm.data.coor.EastNorth;
5import org.openstreetmap.josm.data.coor.LatLon;
6import org.openstreetmap.josm.data.Bounds;
7import 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 */
15public 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 ProjectionBounds getWorldBounds();
66 Bounds getWorldBoundsLatLon();
67}
Note: See TracBrowser for help on using the repository browser.