Changeset 5067 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-03-10T18:51:51+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/projection
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
r4285 r5067 9 9 10 10 import org.openstreetmap.josm.data.coor.LatLon; 11 import java.util.List; 12 import java.util.ArrayList; 11 13 12 14 /** … … 15 17 public class Ellipsoid { 16 18 /** 17 * Clarke 's ellipsoid (NTF system)18 */ 19 public static final Ellipsoid clarke = new Ellipsoid(6378249.2, 6356515.0);19 * Clarke 1880 IGN (French national geographic institute) 20 */ 21 public static final Ellipsoid clarkeIGN = Ellipsoid.create_a_b(6378249.2, 6356515.0); 20 22 /** 21 23 * Hayford's ellipsoid 1909 (ED50 system) 22 24 * Proj.4 code: intl 23 25 */ 24 public static final Ellipsoid hayford = 25 new Ellipsoid(6378388.0, 6356911.9461); 26 public static final Ellipsoid hayford = Ellipsoid.create_a_rf(6378388.0, 297.0); 26 27 /** 27 28 * GRS80 ellipsoid 28 29 */ 29 public static final Ellipsoid GRS80 = new Ellipsoid(6378137.0, 6356752.3141);30 public static final Ellipsoid GRS80 = Ellipsoid.create_a_rf(6378137.0, 298.257222101); 30 31 31 32 /** 32 33 * WGS84 ellipsoid 33 34 */ 34 public static final Ellipsoid WGS84 = new Ellipsoid(6378137.0, 6356752.3142);35 public static final Ellipsoid WGS84 = Ellipsoid.create_a_rf(6378137.0, 298.257223563); 35 36 36 37 /** 37 38 * Bessel 1841 ellipsoid 38 39 */ 39 public static final Ellipsoid Bessel1841 = new Ellipsoid(6377397.155, 6356078.962822);40 public static final Ellipsoid Bessel1841 = Ellipsoid.create_a_rf(6377397.155, 299.1528128); 40 41 41 42 /** … … 62 63 63 64 /** 64 * create a new ellipsoid and precompute its parameters 65 * 66 * @param a ellipsoid long axis (in meters) 67 * @param b ellipsoid short axis (in meters) 68 */ 69 public Ellipsoid(double a, double b) { 65 * private constructur - use one of the create_* methods 66 * 67 * @param a semimajor radius of the ellipsoid axis 68 * @param b semiminor radius of the ellipsoid axis 69 * @param e first eccentricity of the ellipsoid ( = sqrt((a*a - b*b)/(a*a))) 70 * @param e2 first eccentricity squared 71 * @param eb2 square of the second eccentricity 72 */ 73 private Ellipsoid(double a, double b, double e, double e2, double eb2) { 70 74 this.a = a; 71 75 this.b = b; 72 e2 = (a*a - b*b) / (a*a); 73 e = Math.sqrt(e2); 74 eb2 = e2 / (1.0 - e2); 76 this.e = e; 77 this.e2 = e2; 78 this.eb2 = eb2; 79 } 80 81 /** 82 * create a new ellipsoid 83 * 84 * @param a semimajor radius of the ellipsoid axis (in meters) 85 * @param b semiminor radius of the ellipsoid axis (in meters) 86 */ 87 public static Ellipsoid create_a_b(double a, double b) { 88 double e2 = (a*a - b*b) / (a*a); 89 double e = Math.sqrt(e2); 90 double eb2 = e2 / (1.0 - e2); 91 return new Ellipsoid(a, b, e, e2, eb2); 92 } 93 94 /** 95 * create a new ellipsoid 96 * 97 * @param a semimajor radius of the ellipsoid axis (in meters) 98 * @param es first eccentricity squared 99 */ 100 public static Ellipsoid create_a_es(double a, double es) { 101 double b = a * Math.sqrt(1.0 - es); 102 double e = Math.sqrt(es); 103 double eb2 = es / (1.0 - es); 104 return new Ellipsoid(a, b, e, es, eb2); 105 } 106 107 /** 108 * create a new ellipsoid 109 * 110 * @param a semimajor radius of the ellipsoid axis (in meters) 111 * @param f flattening ( = (a - b) / a) 112 */ 113 public static Ellipsoid create_a_f(double a, double f) { 114 double b = a * (1.0 - f); 115 double e2 = f * (2 - f); 116 double e = Math.sqrt(e2); 117 double eb2 = e2 / (1.0 - e2); 118 return new Ellipsoid(a, b, e, e2, eb2); 119 } 120 121 /** 122 * create a new ellipsoid 123 * 124 * @param a semimajor radius of the ellipsoid axis (in meters) 125 * @param rf inverse flattening 126 */ 127 public static Ellipsoid create_a_rf(double a, double rf) { 128 return create_a_f(a, 1.0 / rf); 75 129 } 76 130 -
trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
r5066 r5067 100 100 private void updateParameters(final int layoutZone) { 101 101 this.layoutZone = layoutZone; 102 ellps = Ellipsoid.clarke ;102 ellps = Ellipsoid.clarkeIGN; 103 103 datum = null; // no datum needed, we have a shift file 104 104 nadgrids = ntf_rgf93Grid; -
trunk/src/org/openstreetmap/josm/data/projection/UTM_France_DOM.java
r5066 r5067 24 24 /** 25 25 * This class implements all projections for French departements in the Caribbean Sea and 26 * Indian Ocean using the UTM transvers Mercator projection and specific geodesic settings (7 parameters transformation algorithm).26 * Indian Ocean using the UTM transvers Mercator projection and specific geodesic settings. 27 27 * 28 28 */
Note:
See TracChangeset
for help on using the changeset viewer.