Ignore:
Timestamp:
2017-08-27T00:17:49+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - remove dependence on JMapViewer for package data.coor (only useful for imagery)

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  
    159159        assertEquals(LatLon.normalizeLon(expected.getLon() - result.lon()), 0.0, 1e-4);
    160160        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);
    162162        assertEquals(x, backwardsResult.getXIndex());
    163163        assertEquals(y, backwardsResult.getYIndex());
     
    179179                );
    180180
    181         TileXY tileIndex = source.latLonToTileXY(location.toCoordinate(), z);
     181        TileXY tileIndex = source.latLonToTileXY(CoordinateConversion.llToCoor(location), z);
    182182
    183183        assertTrue("X index: " + tileIndex.getXIndex() + " greater than tileXmax: " + source.getTileXMax(z) + " at zoom: " + z,
     
    213213
    214214    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));
    216216    }
    217217
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java

    r12224 r12669  
    129129
    130130    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));
    132132        assertTrue(ret.toDisplayString() + " doesn't lie within: " + bounds.toString(), bounds.contains(ret));
    133133        int tileXmax = testSource.getTileXMax(z);
     
    303303
    304304    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));
    306306        assertEquals("Latitude", expected.lat(), ll.lat(), 1e-05);
    307307        assertEquals("Longitude", expected.lon(), ll.lon(), 1e-05);
     
    314314    private void verifyMercatorTile(WMTSTileSource testSource, int x, int y, int z, int zoomOffset) {
    315315        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));
    318318        assertEquals("Longitude", LatLon.normalizeLon(expected.lon() - result.lon()), 0.0, 1e-04);
    319319        assertEquals("Latitude", expected.lat(), result.lat(), 1e-04);
Note: See TracChangeset for help on using the changeset viewer.