Changeset 17549 in josm for trunk/test/unit


Ignore:
Timestamp:
2021-03-01T10:48:58+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #20346 - fix definition of EPSG:3346 for Lithuania (patch by nagisa)

File:
1 edited

Legend:

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

    r16916 r17549  
    6262    private final ImageryInfo testImageryGeoAdminCh = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-GeoAdminCh.xml");
    6363    private final ImageryInfo testImagery12168 = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12168-WMTSCapabilities.xml");
     64    private final ImageryInfo testImageryORT2LT = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Lithuania.xml");
    6465    private final ImageryInfo testLotsOfLayers = getImagery(TestUtils.getTestDataRoot() + "wmts/getCapabilities-lots-of-layers.xml");
    6566    private final ImageryInfo testDuplicateTags = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12573-wmts-identifier.xml");
     
    249250                "http://www.ngi.be/cartoweb/1.0.0/topo/default/3857/7/1/1.png",
    250251                testSource.getTileUrl(0, 1, 1));
     252    }
     253
     254    @Test
     255    public void testProjectionWithENUAxis() throws IOException, WMTSGetCapabilitiesException {
     256        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3346"));
     257        WMTSTileSource testSource = new WMTSTileSource(testImageryORT2LT);
     258        testSource.initProjection(ProjectionRegistry.getProjection());
     259        TileXY tileXY0 = testSource.latLonToTileXY(55.31083718860799, 22.172052608196587, 0);
     260        double delta = 1e-10;
     261        assertEquals(27.09619727782481, tileXY0.getX(), delta);
     262        assertEquals(19.03524443532604, tileXY0.getY(), delta);
     263        TileXY tileXY2 = testSource.latLonToTileXY(55.31083718860799, 22.172052608196587, 2);
     264        assertEquals(81.28859183347444, tileXY2.getX(), delta);
     265        assertEquals(57.10573330597811, tileXY2.getY(), delta);
    251266    }
    252267
Note: See TracChangeset for help on using the changeset viewer.