Changeset 8697 in josm for trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
- Timestamp:
- 2015-08-28T07:20:52+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
r8651 r8697 36 36 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); 37 37 TemplatedWMSTileSource source = new TemplatedWMSTileSource(testImageryWMS); 38 verifyMercatorTile(source, 0, 1, 2);39 38 verifyMercatorTile(source, 0, 0, 1); 40 39 verifyMercatorTile(source, 0, 0, 2); … … 126 125 TemplatedTMSTileSource verifier = new TemplatedTMSTileSource(testImageryTMS); 127 126 LatLon result = getTileLatLon(source, x, y, z); 128 LatLon expected = new LatLon(verifier.tileYToLat(y, z - 1), verifier.tileXToLon(x, z - 1)); // 129 assertTrue("result: " + result.toDisplayString() + " osmMercator: " + expected.toDisplayString(), result.equalsEpsilon(expected)); 127 LatLon expected = new LatLon(verifier.tileYToLat(y, z - 1), verifier.tileXToLon(x, z - 1)); 128 assertEquals(expected.lat(), result.lat(), 1e-4); 129 assertEquals(expected.lon(), result.lon(), 1e-4); 130 //assertTrue("result: " + result.toDisplayString() + " osmMercator: " + expected.toDisplayString(), result.equalsEpsilon(expected)); 130 131 LatLon tileCenter = new Bounds(result, getTileLatLon(source, x+1, y+1, z)).getCenter(); 131 132 TileXY backwardsResult = source.latLonToTileXY(tileCenter.toCoordinate(), z); … … 136 137 private void verifyLocation(TemplatedWMSTileSource source, LatLon location) { 137 138 for (int z = source.getMaxZoom(); z > source.getMinZoom() + 1; z--) { 138 verifyLocation(source, location, z); 139 if (source.getTileXMax(z) != source.getTileXMin(z) && source.getTileYMax(z) != source.getTileYMin(z)) { 140 // do the tests only where there is more than one tile 141 verifyLocation(source, location, z); 142 } 139 143 } 140 144 }
Note:
See TracChangeset
for help on using the changeset viewer.