Changeset 11257 in josm for trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
- Timestamp:
- 2016-11-15T21:46:24+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
r10945 r11257 8 8 import java.io.IOException; 9 9 import java.net.MalformedURLException; 10 import java.util.ArrayList; 11 import java.util.Collection; 10 12 11 13 import org.junit.Ignore; … … 38 40 private ImageryInfo testDuplicateTags = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12573-wmts-identifier.xml"); 39 41 private ImageryInfo testMissingStyleIdentifer = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12573-wmts-missing-style-identifier.xml"); 42 private ImageryInfo testMultipleTileMatrixForLayer = getImagery(TestUtils.getTestDataRoot() + 43 "wmts/bug13975-multiple-tile-matrices-for-one-layer-projection.xml"); 40 44 41 45 /** … … 263 267 } 264 268 269 @Test 270 public void testForMultipleTileMatricesForOneLayerProjection() throws Exception { 271 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); 272 ImageryInfo copy = new ImageryInfo(testMultipleTileMatrixForLayer); 273 Collection<DefaultLayer> defaultLayers = new ArrayList<>(1); 274 defaultLayers.add(new WMTSDefaultLayer("Mashhad_BaseMap_1", "default028mm")); 275 copy.setDefaultLayers(defaultLayers); 276 WMTSTileSource testSource = new WMTSTileSource(copy); 277 testSource.initProjection(Main.getProjection()); 278 assertEquals( 279 "http://188.253.0.155:6080/arcgis/rest/services/Mashhad_BaseMap_1/MapServer/WMTS/tile/1.0.0/Mashhad_BaseMap_1" 280 + "/default/default028mm/1/3/2", 281 testSource.getTileUrl(1, 2, 3) 282 ); 283 } 284 265 285 private void verifyTile(LatLon expected, WMTSTileSource source, int x, int y, int z) { 266 286 LatLon ll = new LatLon(source.tileXYToLatLon(x, y, z)); … … 277 297 LatLon result = new LatLon(testSource.tileXYToLatLon(x, y, z)); 278 298 LatLon expected = new LatLon(verifier.tileXYToLatLon(x, y, z + zoomOffset)); 279 //System.out.println(z + "/" + x + "/" + y + " - result: " + result.toDisplayString() + " osmMercator: " + expected.toDisplayString());280 299 assertEquals("Longitude", LatLon.normalizeLon(expected.lon() - result.lon()), 0.0, 1e-04); 281 300 assertEquals("Latitude", expected.lat(), result.lat(), 1e-04);
Note:
See TracChangeset
for help on using the changeset viewer.