Changeset 8752 in josm for trunk/test


Ignore:
Timestamp:
2015-09-13T00:06:23+02:00 (4 years ago)
Author:
wiktorn
Message:

Support situations, where WMTS service provides more than one tile set for one projection.

Closes: #10623

Location:
trunk/test
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java

    r8624 r8752  
    2626    private ImageryInfo testImageryWIEN = getImagery("test/data/wmts/getCapabilities-wien.xml");
    2727    private ImageryInfo testImageryWALLONIE = getImagery("test/data/wmts/WMTSCapabilities-Wallonie.xml");
     28    private ImageryInfo testImageryOntario = getImagery("test/data/wmts/WMTSCapabilities-Ontario.xml");
    2829
    2930    @BeforeClass
     
    4849        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
    4950        WMTSTileSource testSource = new WMTSTileSource(testImageryPSEUDO_MERCATOR);
     51        testSource.initProjection();
    5052
    5153        verifyMercatorTile(testSource, 0, 0, 1);
     
    7880        Main.setProjection(Projections.getProjectionByCode("EPSG:31370"));
    7981        WMTSTileSource testSource = new WMTSTileSource(testImageryWALLONIE);
     82        testSource.initProjection();
     83
    8084        assertEquals("http://geoservices.wallonie.be/arcgis/rest/services/DONNEES_BASE/FOND_PLAN_ANNOTATIONS_2012_RW_NB/"
    8185                + "MapServer/WMTS/tile/1.0.0/DONNEES_BASE_FOND_PLAN_ANNOTATIONS_2012_RW_NB/default/default028mm/5/1219/1063.png",
     
    9599        Main.setProjection(Projections.getProjectionByCode("EPSG:31370"));
    96100        WMTSTileSource testSource = new WMTSTileSource(getImagery("test/data/wmts/WMTSCapabilities-Wallonie-nomatrixdimension.xml"));
     101        testSource.initProjection();
     102
    97103        Bounds wallonieBounds = new Bounds(
    98104                new LatLon(49.485372459967245, 2.840548314430268),
     
    117123        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
    118124        WMTSTileSource testSource = new WMTSTileSource(testImageryWIEN);
     125        testSource.initProjection();
    119126        int zoomOffset = 9;
    120127
     
    158165        Main.setProjection(Projections.getProjectionByCode("EPSG:4326"));
    159166        WMTSTileSource testSource = new WMTSTileSource(testImageryTOPO_PL);
     167        testSource.initProjection();
    160168        verifyTile(new LatLon(56, 12), testSource, 0, 0, 1);
    161169        verifyTile(new LatLon(56, 12), testSource, 0, 0, 2);
     
    179187        Main.setProjection(Projections.getProjectionByCode("EPSG:4326"));
    180188        WMTSTileSource testSource = new WMTSTileSource(testImageryORTO_PL);
     189        testSource.initProjection();
    181190        verifyTile(new LatLon(53.5993712684958, 19.560669777688176), testSource, 12412, 3941, 14);
    182191        verifyTile(new LatLon(49.783096954497786, 22.79034127751704), testSource, 17714, 10206, 14);
     
    187196        Main.setProjection(Projections.getProjectionByCode("EPSG:2180"));
    188197        WMTSTileSource testSource = new WMTSTileSource(testImageryORTO_PL);
     198        testSource.initProjection();
    189199
    190200        verifyTile(new LatLon(53.59940948387726, 19.560544913270064), testSource, 6453, 3140, 14);
    191201        verifyTile(new LatLon(49.782984840526055, 22.790064966993445), testSource, 9932, 9305, 14);
     202    }
     203
     204    // disabled as this needs user action
     205    // @Test
     206    public void testTwoTileSetsForOneProjection() throws Exception {
     207        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
     208        WMTSTileSource testSource = new WMTSTileSource(testImageryOntario);
     209        testSource.initProjection();
     210        verifyTile(new LatLon(45.4105023, -75.7153702), testSource, 303751, 375502, 12);
     211        verifyTile(new LatLon(45.4601306, -75.7617187), testSource, 1186, 1466, 4);
     212
    192213    }
    193214
Note: See TracChangeset for help on using the changeset viewer.