Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 12221)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 12224)
@@ -36,4 +36,5 @@
     private ImageryInfo testImageryWALLONIE = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Wallonie.xml");
     private ImageryInfo testImageryOntario = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Ontario.xml");
+    private ImageryInfo testImageryGeoAdminCh = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-GeoAdminCh.xml");
     private ImageryInfo testImagery12168 = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12168-WMTSCapabilities.xml");
     private ImageryInfo testLotsOfLayers = getImagery(TestUtils.getTestDataRoot() + "wmts/getCapabilities-lots-of-layers.xml");
@@ -245,5 +246,4 @@
         WMTSTileSource testSource = new WMTSTileSource(testLotsOfLayers);
         testSource.initProjection(Main.getProjection());
-
     }
 
@@ -279,4 +279,23 @@
                 "http://188.253.0.155:6080/arcgis/rest/services/Mashhad_BaseMap_1/MapServer/WMTS/tile/1.0.0/Mashhad_BaseMap_1"
                         + "/default/default028mm/1/3/2",
+                testSource.getTileUrl(1, 2, 3)
+                );
+    }
+
+    /**
+     * Test WMTS dimension.
+     * @throws IOException if any I/O error occurs
+     */
+    @Test
+    public void testDimension() throws IOException {
+        Main.setProjection(Projections.getProjectionByCode("EPSG:21781"));
+        ImageryInfo info = new ImageryInfo(testImageryGeoAdminCh);
+        Collection<DefaultLayer> defaultLayers = new ArrayList<>(1);
+        defaultLayers.add(new WMTSDefaultLayer("ch.are.agglomerationen_isolierte_staedte", "21781_26"));
+        info.setDefaultLayers(defaultLayers);
+        WMTSTileSource testSource = new WMTSTileSource(info);
+        testSource.initProjection(Main.getProjection());
+        assertEquals(
+                "http://wmts.geo.admin.ch/1.0.0/ch.are.agglomerationen_isolierte_staedte/default/20140101/21781/1/3/2.png",
                 testSource.getTileUrl(1, 2, 3)
                 );
