Changeset 11648 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/data_nodist/projection/projection-reference-data
r9958 r11648 36863 36863 -55.98383921869693,75.63573463956286,-1305237.430092321,4153869.129437317 36864 36864 72.879933882633,17.159780630468802,7512109.287242818,-227918.925727678 36865 <EPSG:27561> +proj=lcc +lat_0=49.5 +lat_1=48d35'54.682" +lat_2=50d23'45.282" +lon_0=2d20'14.025" +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93 _b.gsb +units=m +bounds=-4.416666666666665,46.65,9.18,51.300000000000004 <>36865 <EPSG:27561> +proj=lcc +lat_0=49.5 +lat_1=48d35'54.682" +lat_2=50d23'45.282" +lon_0=2d20'14.025" +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93.gsb +units=m +bounds=-4.416666666666665,46.65,9.18,51.300000000000004 <> 36866 36866 0.18240099467414606,50.70084348205154,447822.248657583,335749.731598569 36867 36867 0.9331174400163427,50.72485379853146,500898.93039386,337167.651206067 … … 36872 36872 -4.333309987158797,51.19431458229903,134211.681457075,409113.828883267 36873 36873 1.1731830014909175,50.71607717203845,517834.559535807,335902.29111521 36874 <EPSG:27562> +proj=lcc +lat_0=46.8 +lat_1=45d53'56.108" +lat_2=47d41'45.652" +lon_0=2d20'14.025" +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93 _b.gsb +units=m +bounds=-4.416666666666665,43.95,9.18,49.65 <>36874 <EPSG:27562> +proj=lcc +lat_0=46.8 +lat_1=45d53'56.108" +lat_2=47d41'45.652" +lon_0=2d20'14.025" +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93.gsb +units=m +bounds=-4.416666666666665,43.95,9.18,49.65 <> 36875 36875 -1.1133365185429613,46.3561696607643,334590.433494117,156502.072351671 36876 36876 3.0874804507525653,45.63813153451019,658552.478959508,71143.221253895 … … 36881 36881 -3.27634515762172,46.42448034097477,168953.266260769,173664.349652023 36882 36882 -2.0042440238165162,46.66226754677738,267991.824542247,193869.189478427 36883 <EPSG:27563> +proj=lcc +lat_0=44.1 +lat_1=43d11'57.449" +lat_2=44d59'45.938" +lon_0=2d20'14.025" +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93 _b.gsb +units=m +bounds=-4.416666666666665,41.49,9.18,46.95 <>36883 <EPSG:27563> +proj=lcc +lat_0=44.1 +lat_1=43d11'57.449" +lat_2=44d59'45.938" +lon_0=2d20'14.025" +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93.gsb +units=m +bounds=-4.416666666666665,41.49,9.18,46.95 <> 36884 36884 5.248868656095957,46.65569220077895,823071.560393645,488045.265500711 36885 36885 -3.4493869915884816,44.008526482123635,136434.227145081,206138.130591396 … … 36890 36890 8.290835975632522,43.39091449780428,1081988.039463948,138654.923060995 36891 36891 3.5219714239015083,44.69297807859731,693954.617792124,266562.331242614 36892 <EPSG:27564> +proj=lcc +lat_0=42.165 +lat_1=41d33'37.396" +lat_2=42d46'3.588" +lon_0=2d20'14.025" +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93 _b.gsb +units=m +bounds=-4.416666666666665,41.49,9.18,44.267667 <>36892 <EPSG:27564> +proj=lcc +lat_0=42.165 +lat_1=41d33'37.396" +lat_2=42d46'3.588" +lon_0=2d20'14.025" +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +nadgrids=ntf_r93.gsb +units=m +bounds=-4.416666666666665,41.49,9.18,44.267667 <> 36893 36893 -2.544556181890229,43.769485647452164,-392694.173102384,375360.931743444 36894 36894 5.293428616903728,41.7317796332518,246180.966307288,141998.148829765 -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r11324 r11648 31 31 32 32 import org.junit.Assert; 33 import org.junit.Rule; 33 34 import org.junit.Test; 34 35 import org.openstreetmap.josm.data.Bounds; … … 36 37 import org.openstreetmap.josm.data.coor.LatLon; 37 38 import org.openstreetmap.josm.gui.preferences.projection.CodeProjectionChoice; 39 import org.openstreetmap.josm.testutils.JOSMTestRules; 38 40 import org.openstreetmap.josm.tools.Pair; 39 41 import org.openstreetmap.josm.tools.Utils; … … 48 50 * program from the proj.4 library in path (or use <code>CS2CS_EXE</code> to set 49 51 * the full path of the executable). Make sure the required *.gsb grid files 50 * can be accessed, i.e. copy them from <code>data /projection</code> to <code>/usr/share/proj</code> or52 * can be accessed, i.e. copy them from <code>data_nodist/projection</code> to <code>/usr/share/proj</code> or 51 53 * wherever cs2cs expects them to be placed. 52 54 * … … 75 77 76 78 static Random rand = new SecureRandom(); 79 80 /** 81 * Setup test. 82 */ 83 @Rule 84 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 85 public JOSMTestRules test = new JOSMTestRules().platform(); 77 86 78 87 /** … … 284 293 } 285 294 295 /** 296 * Test projections. 297 * @throws IOException if any I/O error occurs 298 */ 286 299 @Test 287 300 public void testProjections() throws IOException { … … 296 309 } 297 310 if (!ref.def.equals(def0)) { 298 Assert.fail("definitions for " + ref.code + " do not match"); 299 } 300 Projection proj = Projections.getProjectionByCode(ref.code); 301 double scale = ((CustomProjection) proj).getToMeter(); 302 for (Pair<LatLon, EastNorth> p : ref.data) { 303 LatLon ll = p.a; 304 EastNorth enRef = p.b; 305 enRef = new EastNorth(enRef.east() * scale, enRef.north() * scale); // convert to meter 306 307 EastNorth en = proj.latlon2eastNorth(ll); 308 if (proj.switchXY()) { 309 en = new EastNorth(en.north(), en.east()); 310 } 311 en = new EastNorth(en.east() * scale, en.north() * scale); // convert to meter 312 final double EPSILON_EN = 1e-2; // 1cm 313 if (!isEqual(enRef, en, EPSILON_EN, true)) { 314 String errorEN = String.format("%s (%s): Projecting latlon(%s,%s):%n" + 315 " expected: eastnorth(%s,%s),%n" + 316 " but got: eastnorth(%s,%s)!%n", 317 proj.toString(), proj.toCode(), ll.lat(), ll.lon(), enRef.east(), enRef.north(), en.east(), en.north()); 318 fail.append(errorEN); 311 fail.append("definitions for ").append(ref.code).append(" do not match\n"); 312 } else { 313 Projection proj = Projections.getProjectionByCode(ref.code); 314 double scale = ((CustomProjection) proj).getToMeter(); 315 for (Pair<LatLon, EastNorth> p : ref.data) { 316 LatLon ll = p.a; 317 EastNorth enRef = p.b; 318 enRef = new EastNorth(enRef.east() * scale, enRef.north() * scale); // convert to meter 319 320 EastNorth en = proj.latlon2eastNorth(ll); 321 if (proj.switchXY()) { 322 en = new EastNorth(en.north(), en.east()); 323 } 324 en = new EastNorth(en.east() * scale, en.north() * scale); // convert to meter 325 final double EPSILON_EN = 1e-2; // 1cm 326 if (!isEqual(enRef, en, EPSILON_EN, true)) { 327 String errorEN = String.format("%s (%s): Projecting latlon(%s,%s):%n" + 328 " expected: eastnorth(%s,%s),%n" + 329 " but got: eastnorth(%s,%s)!%n", 330 proj.toString(), proj.toCode(), ll.lat(), ll.lon(), enRef.east(), enRef.north(), en.east(), en.north()); 331 fail.append(errorEN); 332 } 319 333 } 320 334 }
Note:
See TracChangeset
for help on using the changeset viewer.