Changeset 9820 in josm for trunk/test


Ignore:
Timestamp:
2016-02-18T07:29:48+01:00 (4 years ago)
Author:
wiktorn
Message:

Fix unit tests after [9818]. Move all zoom levels one level lower.

See: #12350

File:
1 edited

Legend:

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

    r9767 r9820  
    7676        verifyMercatorTile(testSource, 2 << 9 - 1, 2 << 8 - 1, 10);
    7777
    78         assertEquals("TileXMax", 1, testSource.getTileXMax(1));
    79         assertEquals("TileYMax", 1, testSource.getTileYMax(1));
    80         assertEquals("TileXMax", 2, testSource.getTileXMax(2));
    81         assertEquals("TileYMax", 2, testSource.getTileYMax(2));
    82         assertEquals("TileXMax", 4, testSource.getTileXMax(3));
    83         assertEquals("TileYMax", 4, testSource.getTileYMax(3));
     78        assertEquals("TileXMax", 1, testSource.getTileXMax(0));
     79        assertEquals("TileYMax", 1, testSource.getTileYMax(0));
     80        assertEquals("TileXMax", 2, testSource.getTileXMax(1));
     81        assertEquals("TileYMax", 2, testSource.getTileYMax(1));
     82        assertEquals("TileXMax", 4, testSource.getTileXMax(2));
     83        assertEquals("TileYMax", 4, testSource.getTileYMax(2));
    8484
    8585    }
     
    9393        assertEquals("http://geoservices.wallonie.be/arcgis/rest/services/DONNEES_BASE/FOND_PLAN_ANNOTATIONS_2012_RW_NB/"
    9494                + "MapServer/WMTS/tile/1.0.0/DONNEES_BASE_FOND_PLAN_ANNOTATIONS_2012_RW_NB/default/default028mm/5/1219/1063.png",
    95                 testSource.getTileUrl(6, 1063, 1219));
     95                testSource.getTileUrl(5, 1063, 1219));
    9696
    9797        // +bounds=2.54,49.51,6.4,51.5
     
    100100                new LatLon(50.820959517561256, 6.427849693016202)
    101101                );
    102         verifyBounds(wallonieBounds, testSource, 6, 1063, 1219);
    103         verifyBounds(wallonieBounds, testSource, 11, 17724, 20324);
     102        verifyBounds(wallonieBounds, testSource, 5, 1063, 1219);
     103        verifyBounds(wallonieBounds, testSource, 10, 17724, 20324);
    104104    }
    105105
     
    134134        WMTSTileSource testSource = new WMTSTileSource(testImageryWIEN);
    135135        testSource.initProjection(Main.getProjection());
    136         int zoomOffset = 9;
     136        int zoomOffset = 10;
    137137
    138138        verifyMercatorTile(testSource, 0, 0, 1, zoomOffset);
     
    178178        verifyTile(new LatLon(56, 12), testSource, 0, 0, 1);
    179179        verifyTile(new LatLon(56, 12), testSource, 0, 0, 2);
    180         verifyTile(new LatLon(51.13231917844218, 16.867680821557823), testSource, 1, 1, 2);
    181 
    182         assertEquals("TileXMax", 2, testSource.getTileXMax(1));
    183         assertEquals("TileYMax", 1, testSource.getTileYMax(1));
    184         assertEquals("TileXMax", 3, testSource.getTileXMax(2));
    185         assertEquals("TileYMax", 2, testSource.getTileYMax(2));
    186         assertEquals("TileXMax", 6, testSource.getTileXMax(3));
    187         assertEquals("TileYMax", 4, testSource.getTileYMax(3));
     180        verifyTile(new LatLon(51.13231917844218, 16.867680821557823), testSource, 1, 1, 1);
     181
     182        assertEquals("TileXMax", 2, testSource.getTileXMax(0));
     183        assertEquals("TileYMax", 1, testSource.getTileYMax(0));
     184        assertEquals("TileXMax", 3, testSource.getTileXMax(1));
     185        assertEquals("TileYMax", 2, testSource.getTileYMax(1));
     186        assertEquals("TileXMax", 6, testSource.getTileXMax(2));
     187        assertEquals("TileYMax", 4, testSource.getTileYMax(2));
    188188        assertEquals(
    189189                "http://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/TOPO?SERVICE=WMTS&REQUEST=GetTile&"
    190190                + "VERSION=1.0.0&LAYER=MAPA TOPOGRAFICZNA&STYLE=default&FORMAT=image/jpeg&tileMatrixSet=EPSG:4326&"
    191191                + "tileMatrix=EPSG:4326:0&tileRow=1&tileCol=1",
    192                 testSource.getTileUrl(1,  1,  1));
     192                testSource.getTileUrl(0,  1,  1));
    193193    }
    194194
     
    198198        WMTSTileSource testSource = new WMTSTileSource(testImageryORTO_PL);
    199199        testSource.initProjection(Main.getProjection());
    200         verifyTile(new LatLon(53.60205873528009, 19.552206794646956), testSource, 12412, 3941, 14);
    201         verifyTile(new LatLon(49.79005619189761, 22.778262259134397), testSource, 17714, 10206, 14);
     200        verifyTile(new LatLon(53.60205873528009, 19.552206794646956), testSource, 12412, 3941, 13);
     201        verifyTile(new LatLon(49.79005619189761, 22.778262259134397), testSource, 17714, 10206, 13);
    202202    }
    203203
     
    208208        testSource.initProjection(Main.getProjection());
    209209
    210         verifyTile(new LatLon(53.59940948387726, 19.560544913270064), testSource, 6453, 3140, 14);
    211         verifyTile(new LatLon(49.782984840526055, 22.790064966993445), testSource, 9932, 9305, 14);
     210        verifyTile(new LatLon(53.59940948387726, 19.560544913270064), testSource, 6453, 3140, 13);
     211        verifyTile(new LatLon(49.782984840526055, 22.790064966993445), testSource, 9932, 9305, 13);
    212212    }
    213213
     
    219219        assertEquals(
    220220                "http://www.ngi.be/cartoweb/1.0.0/topo/default/3857/7/1/1.png",
    221                 testSource.getTileUrl(1,  1,  1));
     221                testSource.getTileUrl(0,  1,  1));
    222222    }
    223223
     
    251251
    252252    private void verifyMercatorTile(WMTSTileSource testSource, int x, int y, int z) {
    253         verifyMercatorTile(testSource, x, y, z, -1);
     253        verifyMercatorTile(testSource, x, y, z, 0);
    254254    }
    255255
Note: See TracChangeset for help on using the changeset viewer.