Changeset 5230 in josm
- Timestamp:
- 2012-05-11T17:11:04+02:00 (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data_nodist/projection-regression-test-data.csv
r5067 r5230 969 969 en 3266743.101643809 8326980.665451931 970 970 ll2 -15.122420619099696 174.82953069806615 971 EPSG:31370 972 ll 49.91513996934379 3.0892264075922404 973 en 58108.251968638695 67871.94610605389 974 ll2 49.91513997291573 3.0892264054277314 975 EPSG:3812 976 ll 50.76787953358437 3.4513353977071453 977 en 585284.6677650046 662323.5758590293 978 ll2 50.76787953358439 3.4513353977071453 979 EPSG:21781 980 ll 46.582471410091934 8.159223152110604 981 en 655231.0208778976 159275.39184032555 982 ll2 46.58247142005926 8.159223160343661 971 983 EPSG:31466 972 984 ll 7.0210401440287065 6.5142293675331056 … … 985 997 en 5533907.888998117 8406162.271952605 986 998 ll2 75.7147487977527 16.230800026412293 987 EPSG:31370988 ll 49.91513996934379 3.0892264075922404989 en 58108.251968638695 67871.94610605389990 ll2 49.91513997291573 3.0892264054277314991 EPSG:3812992 ll 50.76787953358437 3.4513353977071453993 en 585284.6677650046 662323.5758590293994 ll2 50.76787953358439 3.4513353977071453995 999 EPSG:3301 996 1000 ll 59.493759099912154 27.525338967200614 … … 999 1003 EPSG:27561 1000 1004 ll 48.687023294540744 9.13470536591202 1001 en 1099861.43 30225135 132165.345951852941002 ll2 48.687023294540765 9.13470536591202 1005 en 1099861.4328694288 132165.3475888513 1006 ll2 48.687023294540765 9.134705365912021 1003 1007 EPSG:27562 1004 1008 ll 47.083336187611536 -1.6746579886431774 1005 en 295565.173 9406001 239272.036896651931006 ll2 47.08333618761155 -1.67465798864317 561009 en 295565.17384739226 239272.03526596428 1010 ll2 47.08333618761155 -1.6746579886431774 1007 1011 EPSG:27563 1008 1012 ll 46.443136133672226 5.992820527372115 1009 en 881070.780 4436726 466693.76846498291010 ll2 46.44313613367226 5.99282052737211 61013 en 881070.7805340261 466693.7656533603 1014 ll2 46.44313613367226 5.992820527372114 1011 1015 EPSG:27564 1012 1016 ll 43.42400252536329 0.5163786716368639 1013 en -147178.2200 7173466 327298.18143102461017 en -147178.2200372536 327298.1840058803 1014 1018 ll2 43.42400252536333 0.5163786716368636 1015 1019 EPSG:2154 … … 1101 1105 en 128126.42078859449 6861850.502124558 1102 1106 ll2 61.86405448889923 13.084399903079852 1103 EPSG:217811104 ll 46.582471410091934 8.1592231521106041105 en 655231.0208778976 159275.391840325551106 ll2 46.58247142005926 8.159223160343661 -
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.