Ticket #20346: fix-3346.diff

File fix-3346.diff, 6.9 KB (added by nagisa, 3 years ago)

The patch

  • nodist/data/projection/josm-epsg

     
    7474<3059> +proj=tmerc +lon_0=24 +k_0=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +nadgrids=null +units=m +axis=neu +bounds=-18,54,30,60  <>
    7575# Lambert Zone (Estonia)
    7676<3301> +proj=lcc +lat_0=57.51755393055556 +lat_1=59.333333333333336 +lat_2=58 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +nadgrids=null +units=m +axis=neu +bounds=21.64,56.05,28.58,61.13  <>
     77# LKS94 / Lithuania TM
     78<3346> +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +axis=neu +bounds=19.03,53.89,26.84,56.46 +no_defs <>
    7779# Belgian Lambert 2008
    7880<3812> +proj=lcc +lat_0=50d47'52.134" +lat_1=49d50'0" +lat_2=51d10'0" +lon_0=4d21'33.177" +x_0=649328 +y_0=665262 +ellps=GRS80 +nadgrids=null +units=m +bounds=2.54,49.51,6.4,51.5  <>
    7981# WGS 84 / Pseudo-Mercator
  • test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java

     
    6161    private final ImageryInfo testImageryOntario = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Ontario.xml");
    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");
    6667    private final ImageryInfo testMissingStyleIdentifier = getImagery(TestUtils.getTestDataRoot() +
     
    251252    }
    252253
    253254    @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        assertEquals(27, (int)tileXY0.getX());
     261        assertEquals(19, (int)tileXY0.getY());
     262        TileXY tileXY2 = testSource.latLonToTileXY(55.31083718860799, 22.172052608196587, 2);
     263        assertEquals(81, (int)tileXY2.getX());
     264        assertEquals(57, (int)tileXY2.getY());
     265    }
     266
     267    @Test
    254268    public void testTwoTileSetsForOneProjection() throws Exception {
    255269        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
    256270        ImageryInfo ontario = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Ontario.xml");
  • test/data/wmts/WMTSCapabilities-Lithuania.xml

     
     1<?xml version="1.0" encoding="UTF-8"?>
     2<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
     3    <Contents>
     4        <Layer>
     5            <ows:Title>NZT_ORT2LT_2018</ows:Title>
     6            <ows:Identifier>NZT_ORT2LT_2018</ows:Identifier>
     7            <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3346">
     8                <ows:LowerCorner>6022999.8655913975 316000.06350012776</ows:LowerCorner>
     9                <ows:UpperCorner>6211000.061383456 605999.984124969</ows:UpperCorner>
     10            </ows:BoundingBox>
     11            <ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
     12                <ows:LowerCorner>21.05003442434057 54.31083718956931</ows:LowerCorner>
     13                <ows:UpperCorner>25.70028436683549 56.0330467679823</ows:UpperCorner>
     14            </ows:WGS84BoundingBox>
     15            <Style isDefault="true">
     16                <ows:Title>Default Style</ows:Title>
     17                <ows:Identifier>default</ows:Identifier>
     18            </Style>
     19            <Format>image/png</Format>
     20            <TileMatrixSetLink>
     21                <TileMatrixSet>default028mm</TileMatrixSet>
     22            </TileMatrixSetLink>
     23            <ResourceURL format="image/png" resourceType="tile" template="https://this_is_test/tile/{TileMatrix}/{TileRow}/{TileCol}"/>
     24        </Layer>
     25        <TileMatrixSet>
     26            <ows:Title>TileMatrix using 0.28mm</ows:Title>
     27            <ows:Abstract>The tile matrix set that has scale values calculated based on the dpi defined by OGC specification (dpi assumes 0.28mm as the physical distance of a pixel).</ows:Abstract>
     28            <ows:Identifier>default028mm</ows:Identifier>
     29            <ows:SupportedCRS>urn:ogc:def:crs:EPSG::3346</ows:SupportedCRS>
     30            <TileMatrix>
     31                <ows:Identifier>0</ows:Identifier>
     32                <ScaleDenominator>2834827.0982252685</ScaleDenominator>
     33                <TopLeftCorner>1.00001E7 -5122000.0</TopLeftCorner>
     34                <TileWidth>256</TileWidth>
     35                <TileHeight>256</TileHeight>
     36                <MatrixWidth>29</MatrixWidth>
     37                <MatrixHeight>20</MatrixHeight>
     38            </TileMatrix>
     39            <TileMatrix>
     40                <ows:Identifier>1</ows:Identifier>
     41                <ScaleDenominator>1889884.7321501793</ScaleDenominator>
     42                <TopLeftCorner>1.00001E7 -5122000.0</TopLeftCorner>
     43                <TileWidth>256</TileWidth>
     44                <TileHeight>256</TileHeight>
     45                <MatrixWidth>43</MatrixWidth>
     46                <MatrixHeight>30</MatrixHeight>
     47            </TileMatrix>
     48            <TileMatrix>
     49                <ows:Identifier>2</ows:Identifier>
     50                <ScaleDenominator>944942.3660750897</ScaleDenominator>
     51                <TopLeftCorner>1.00001E7 -5122000.0</TopLeftCorner>
     52                <TileWidth>256</TileWidth>
     53                <TileHeight>256</TileHeight>
     54                <MatrixWidth>85</MatrixWidth>
     55                <MatrixHeight>59</MatrixHeight>
     56            </TileMatrix>
     57        </TileMatrixSet>
     58    </Contents>
     59    <ServiceMetadataURL xlink:href="http://www.geoportal.lt/arcgis/rest/services/NZT/ORT2LT_2018/MapServer/WMTS/1.0.0/WMTSCapabilities.xml"/>
     60</Capabilities>