- Timestamp:
- 2012-05-11T17:11:04+02: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/Lambert.java
r5226 r5230 6 6 import java.awt.GridBagLayout; 7 7 import java.awt.event.ActionListener; 8 import java.io.InputStream;9 8 import java.util.Collection; 10 9 import java.util.Collections; … … 14 13 import javax.swing.JPanel; 15 14 16 import org.openstreetmap.josm.Main;17 15 import org.openstreetmap.josm.data.Bounds; 18 16 import org.openstreetmap.josm.data.coor.LatLon; 19 17 import org.openstreetmap.josm.data.projection.datum.NTV2Datum; 20 import org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFile;21 18 import org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFileWrapper; 22 19 import org.openstreetmap.josm.data.projection.proj.LambertConformalConic; … … 29 26 * This newer version uses the grid translation NTF<->RGF93 provided by IGN for a submillimetric accuracy. 30 27 * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal) 28 * 29 * Source: http://professionnels.ign.fr/DISPLAY/000/526/700/5267002/transformation.pdf 31 30 * @author Pieren 32 31 */ 33 32 public class Lambert extends AbstractProjection implements ProjectionSubPrefs { 34 /** 35 * Lambert I, II, III, and IV projection exponents 36 */ 37 private static final double n[] = { 0.7604059656, 0.7289686274, 0.6959127966, 0.6712679322 }; 38 39 /** 40 * Lambert I, II, III, and IV projection constants 41 */ 42 private static final double c[] = { 11603796.98, 11745793.39, 11947992.52, 12136281.99 }; 33 34 /** 35 * Lambert I, II, III, and IV latitude origin 36 */ 37 private static final double lat_0s[] = { 49.5, 46.8, 44.1, 42.165 }; 38 39 /** 40 * Lambert I, II, III, and IV latitude of first standard parallel 41 */ 42 private static final double lat_1s[] = { 43 convertDegreeMinuteSecond(48, 35, 54.682), 44 convertDegreeMinuteSecond(45, 53, 56.108), 45 convertDegreeMinuteSecond(43, 11, 57.449), 46 convertDegreeMinuteSecond(41, 33, 37.396)}; 47 48 /** 49 * Lambert I, II, III, and IV latitude of second standard parallel 50 */ 51 private static final double lat_2s[] = { 52 convertDegreeMinuteSecond(50, 23, 45.282), 53 convertDegreeMinuteSecond(47, 41, 45.652), 54 convertDegreeMinuteSecond(44, 59, 45.938), 55 convertDegreeMinuteSecond(42, 46, 3.588)}; 43 56 44 57 /** … … 46 59 */ 47 60 private static final double x_0s[] = { 600000.0, 600000.0, 600000.0, 234.358 }; 48 61 49 62 /** 50 63 * Lambert I, II, III, and IV false north 51 64 */ 52 private static final double y_ fs[] = { 5657616.674, 6199695.768, 6791905.085, 7239161.542};53 65 private static final double y_0s[] = { 200000.0, 200000.0, 200000.0, 185861.369 }; 66 54 67 /** 55 68 * France is divided in 4 Lambert projection zones (1,2,3 + 4th for Corsica) … … 87 100 datum = new NTV2Datum("ntf_rgf93Grid", null, ellps, NTV2GridShiftFileWrapper.ntf_rgf93); 88 101 x_0 = x_0s[layoutZone]; 102 y_0 = y_0s[layoutZone]; 89 103 lon_0 = 2.0 + 20.0 / 60 + 14.025 / 3600; // 0 grade Paris 90 104 if (proj == null) { … … 95 109 proj.initialize(new ProjParameters() {{ 96 110 ellps = Lambert.this.ellps; 97 l cc_n = n[layoutZone];98 l cc_F = c[layoutZone] / ellps.a;99 l cc_r0 = y_fs[layoutZone] / ellps.a;111 lat_0 = lat_0s[layoutZone]; 112 lat_1 = lat_1s[layoutZone]; 113 lat_2 = lat_2s[layoutZone]; 100 114 }}); 101 115 } catch (ProjectionConfigurationException e) { -
trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java
r5066 r5230 67 67 ellps = params.ellps; 68 68 e = ellps.e; 69 if (params.lcc_n != null && params.lcc_F != null && params.lcc_r0 != null) { 70 initializeDirect(params.lcc_n, params.lcc_F, params.lcc_r0); 69 if (params.lat_0 == null) 70 throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0")); 71 if (params.lat_1 != null && params.lat_2 != null) { 72 initialize2SP(params.lat_0, params.lat_1, params.lat_2); 71 73 } else { 72 if (params.lat_0 == null) 73 throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0")); 74 if (params.lat_1 != null && params.lat_2 != null) { 75 initialize2SP(params.lat_0, params.lat_1, params.lat_2); 76 } else { 77 initialize1SP(params.lat_0); 78 } 74 initialize1SP(params.lat_0); 79 75 } 80 76 } … … 117 113 F = m0 / (n * pow(t0, n)); 118 114 r0 = F * pow(t0, n); 119 }120 121 /**122 * Initialize LCC by providing the projection parameters directly.123 *124 * @param n see field n125 * @param F see field F126 * @param r0 see field r0127 */128 private void initializeDirect(double n, double F, double r0) {129 this.params = null;130 this.n = n;131 this.F = F;132 this.r0 = r0;133 115 } 134 116 -
trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java
r5066 r5230 15 15 public Double lat_2; 16 16 17 /* for LambertConformalConic */18 public Double lcc_n;19 public Double lcc_F;20 public Double lcc_r0;21 22 17 }
Note:
See TracChangeset
for help on using the changeset viewer.