Changeset 8542 in josm for trunk/test/unit/org
- Timestamp:
- 2015-06-30T13:57:53+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
r8530 r8542 48 48 } 49 49 } 50 verifyTileSquarness(source, 2270, 1323, 12); 50 51 verifyLocation(source, new LatLon(53.5937132, 19.5652017)); 51 52 verifyLocation(source, new LatLon(53.501565692302854, 18.54455233898721)); … … 62 63 verifyTileSquarness(source, 2, 2, 2); 63 64 verifyTileSquarness(source, 150, 20, 18); 65 verifyTileSquarness(source, 2270, 1323, 12); 64 66 } 65 67 … … 74 76 verifyTileSquarness(source, 2, 2, 2); 75 77 verifyTileSquarness(source, 150, 20, 18); 76 78 verifyTileSquarness(source, 2270, 1323, 12); 77 79 } 78 80 … … 112 114 private void verifyTileSquarness(TemplatedWMSTileSource source, int x, int y, int z) { 113 115 Projection proj = Main.getProjection(); 114 EastNorth min = proj.latlon2eastNorth(getTileLatLon(source, x, y, z)); 115 EastNorth max = proj.latlon2eastNorth(getTileLatLon(source, x + 1, y + 1, z)); 116 double y_size = Math.abs(min.getY() - max.getY()); 117 double x_size = Math.abs(min.getX() - max.getX()); 116 /** 117 * t1 | t2 118 * ------- 119 * t3 | t4 120 */ 121 EastNorth t1 = proj.latlon2eastNorth(getTileLatLon(source, x, y, z)); 122 EastNorth t2 = proj.latlon2eastNorth(getTileLatLon(source, x + 1, y, z)); 123 EastNorth t3 = proj.latlon2eastNorth(getTileLatLon(source, x, y + 1, z)); 124 EastNorth t4 = proj.latlon2eastNorth(getTileLatLon(source, x + 1, y + 1, z)); 125 double y_size = Math.abs(t1.getY() - t4.getY()); 126 double x_size = Math.abs(t1.getX() - t4.getX()); 118 127 assertEquals(x_size, y_size, 1e-05); 128 assertEquals(y_size, Math.abs(t1.getY() - t3.getY()), 1e-05); 129 assertEquals(x_size, Math.abs(t1.getX() - t2.getX()), 1e-05); 130 131 t1 = source.getTileEastNorth(x, y, z); 132 t2 = source.getTileEastNorth(x + 1, y, z); 133 t3 = source.getTileEastNorth(x, y + 1, z); 134 t4 = source.getTileEastNorth(x + 1, y + 1, z); 135 y_size = Math.abs(t1.getY() - t4.getY()); 136 x_size = Math.abs(t1.getX() - t4.getX()); 137 assertEquals(x_size, y_size, 1e-05); 138 assertEquals(y_size, Math.abs(t1.getY() - t3.getY()), 1e-05); 139 assertEquals(x_size, Math.abs(t1.getX() - t2.getX()), 1e-05); 119 140 } 120 141
Note:
See TracChangeset
for help on using the changeset viewer.