View Javadoc

1   /*
2    * Trip Tracker, a real-time position tracking system for the Internet.
3    * Copyright (C) 2006  Team Trip Tracker
4    *
5    * This program is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License as published by the
7    * Free Software Foundation; either version 2 of the License, or (at your
8    * option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful, but
11   * WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License along
16   * with this program; if not, write to the Free Software Foundation, Inc.,
17   * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18   */
19  
20  package triptracker.core;
21  
22  /***
23   * The Earth is not an exact ellipsoid.  In fact, because the Earth is such a
24   * "lumpy" ellipsoid no single smooth ellipsoid will provide a perfect reference
25   * surface for the entire Earth. 
26   * <p>
27   * The practical solution to this is to measure the Earth's shape in different
28   * areas and to then create different reference ellipsoids used for mapping
29   * different regions on Earth.
30   * <p>
31   * Different datums is used for flattening out this lumpy ellipsoid. They create
32   * an reference ellipsoid used for mapping different regions on earth. The
33   * reference ellipsoid is created by the Earth's radius and the Earths
34   * eccentricity values. Evidently, these values are different for each datum.
35   *  
36   * @see 
37   * <a href="http://exchange.manifold.net/manifold/manuals/5_userman/mfd50The_Earth_as_an_Ellipsoid.htm">
38   * The Earth as an Ellipsoid:</a>
39   */
40  public class ReferenceEllipsoids {
41  	// FIXME Convert everything to an enum.
42  	public static final int AIRY = 0;
43  	public static final int AUSTRALIAN_NATIONAL = 1;
44  	public static final int BESSEL_1841 = 2;
45  	public static final int BESSEL_1841_NAMIBIA = 3;
46  	public static final int CLARKE_1866 = 4;
47  	public static final int CLARKE_1880 = 5;
48  	public static final int EVEREST = 6;
49  	public static final int FISHER_1960_MERCURY = 7;
50  	public static final int FISHER_1968 = 8;
51  	public static final int GRS_1967 = 9;
52  	public static final int GRS_1980 = 10;
53  	public static final int HELMERT_1906 = 11;
54  	public static final int HOUGH = 12;
55  	public static final int INTERNATIONAL = 13;
56  	public static final int KRASSOVSKY = 14;
57  	public static final int MODIFIED_AIRY = 15;
58  	public static final int MODIFIED_EVEREST = 16;
59  	public static final int MODIFIED_FISCHER_1960 = 17;
60  	public static final int SOUTH_AMERICAN_1969 = 18;
61  	public static final int WGS_60 = 19;
62  	public static final int WGS_66 = 20;
63  	public static final int WGS_72 = 21;
64  	public static final int WGS_84 = 22;
65  	private static Ellipsoid ellipsoids[] = {
66  		new Ellipsoid("Airy", 6377563D, 0.00667054D),
67  		new Ellipsoid("Australian National", 6378160D, 0.0066945420000000004D),
68  		new Ellipsoid("Bessel 1841", 6377397D, 0.0066743719999999996D),
69  		new Ellipsoid("Bessel 1841 (Nambia)", 6377484D, 0.0066743719999999996D),
70  		new Ellipsoid("Clarke 1866", 6378206D, 0.0067686580000000003D),
71  		new Ellipsoid("Clarke 1880", 6378249D, 0.0068035109999999999D),
72  		new Ellipsoid("Everest", 6377276D, 0.0066378469999999997D),
73  		new Ellipsoid("Fischer 1960 (Mercury)", 6378166D,
74  				0.0066934220000000001D),
75  		new Ellipsoid("Fischer 1968", 6378150D, 0.0066934220000000001D),
76  		new Ellipsoid("GRS 1967", 6378160D, 0.0066946050000000002D), 
77  		new Ellipsoid("GRS 1980", 6378137D, 0.0066943799999999998D),
78  		new Ellipsoid("Helmert 1906", 6378200D, 0.0066934220000000001D),
79  		new Ellipsoid("Hough", 6378270D, 0.00672267D),
80  		new Ellipsoid("International", 6378388D, 0.00672267D),
81  		new Ellipsoid("Krassovsky", 6378245D, 0.0066934220000000001D),
82  		new Ellipsoid("Modified Airy", 6377340D, 0.00667054D),
83  		new Ellipsoid("Modified Everest", 6377304D, 0.0066378469999999997D),
84  		new Ellipsoid("Modified Fischer 1960", 6378155D,
85  				0.0066934220000000001D),
86  		new Ellipsoid("South American 1969", 6378160D, 0.0066945420000000004D),
87  		new Ellipsoid("WGS 60", 6378165D, 0.0066934220000000001D), 
88  		new Ellipsoid("WGS 66", 6378145D, 0.0066945420000000004D),
89  		new Ellipsoid("WGS-72", 6378135D, 0.0066943180000000003D),
90  		new Ellipsoid("WGS-84", 6378137D, 0.0066943799999999998D)
91  	};
92  
93  	private ReferenceEllipsoids() {
94  	}
95  
96  	public static Ellipsoid getEllipsoid(int i) {
97  		if (i < 0 || i > 22) {
98  			return null;
99  		} else {
100 			return ellipsoids[i];
101 		}
102 	}
103 
104 	public static Ellipsoid[] getEllipsoids() {
105 		return ellipsoids;
106 	}
107 
108 }