Changeset 12669 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2017-08-27T00:17:49+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/imagery
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
r11859 r12669 159 159 assertEquals(LatLon.normalizeLon(expected.getLon() - result.lon()), 0.0, 1e-4); 160 160 LatLon tileCenter = new Bounds(result, getTileLatLon(source, x+1, y+1, z)).getCenter(); 161 TileXY backwardsResult = source.latLonToTileXY( tileCenter.toCoordinate(), z);161 TileXY backwardsResult = source.latLonToTileXY(CoordinateConversion.llToCoor(tileCenter), z); 162 162 assertEquals(x, backwardsResult.getXIndex()); 163 163 assertEquals(y, backwardsResult.getYIndex()); … … 179 179 ); 180 180 181 TileXY tileIndex = source.latLonToTileXY( location.toCoordinate(), z);181 TileXY tileIndex = source.latLonToTileXY(CoordinateConversion.llToCoor(location), z); 182 182 183 183 assertTrue("X index: " + tileIndex.getXIndex() + " greater than tileXmax: " + source.getTileXMax(z) + " at zoom: " + z, … … 213 213 214 214 private LatLon getTileLatLon(TemplatedWMSTileSource source, int x, int y, int z) { 215 return new LatLon(source.tileXYToLatLon(x, y, z));215 return CoordinateConversion.coorToLL(source.tileXYToLatLon(x, y, z)); 216 216 } 217 217 -
trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
r12224 r12669 129 129 130 130 private void verifyBounds(Bounds bounds, WMTSTileSource testSource, int z, int x, int y) { 131 LatLon ret = new LatLon(testSource.tileXYToLatLon(x, y, z));131 LatLon ret = CoordinateConversion.coorToLL(testSource.tileXYToLatLon(x, y, z)); 132 132 assertTrue(ret.toDisplayString() + " doesn't lie within: " + bounds.toString(), bounds.contains(ret)); 133 133 int tileXmax = testSource.getTileXMax(z); … … 303 303 304 304 private void verifyTile(LatLon expected, WMTSTileSource source, int x, int y, int z) { 305 LatLon ll = new LatLon(source.tileXYToLatLon(x, y, z));305 LatLon ll = CoordinateConversion.coorToLL(source.tileXYToLatLon(x, y, z)); 306 306 assertEquals("Latitude", expected.lat(), ll.lat(), 1e-05); 307 307 assertEquals("Longitude", expected.lon(), ll.lon(), 1e-05); … … 314 314 private void verifyMercatorTile(WMTSTileSource testSource, int x, int y, int z, int zoomOffset) { 315 315 TemplatedTMSTileSource verifier = new TemplatedTMSTileSource(testImageryTMS); 316 LatLon result = new LatLon(testSource.tileXYToLatLon(x, y, z));317 LatLon expected = new LatLon(verifier.tileXYToLatLon(x, y, z + zoomOffset));316 LatLon result = CoordinateConversion.coorToLL(testSource.tileXYToLatLon(x, y, z)); 317 LatLon expected = CoordinateConversion.coorToLL(verifier.tileXYToLatLon(x, y, z + zoomOffset)); 318 318 assertEquals("Longitude", LatLon.normalizeLon(expected.lon() - result.lon()), 0.0, 1e-04); 319 319 assertEquals("Latitude", expected.lat(), result.lat(), 1e-04);
Note:
See TracChangeset
for help on using the changeset viewer.