diff --git a/examples/data/WMTSCapabilities.xml b/examples/data/WMTSCapabilities.xml
index b58c4644b5..8d8ed8c846 100644
--- a/examples/data/WMTSCapabilities.xml
+++ b/examples/data/WMTSCapabilities.xml
@@ -1,374 +1,2357 @@
+
-
- Web Map Tile Service
- OGC WMTS
- 1.0.0
- none
- http://data.wien.gv.at/nutzungsbedingungen
-
-
- Magistrat Wien
-
-
- Gerhard Sommer
-
-
-
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
- RESTful
-
-
-
-
-
-
-
-
-
- Luftbild
-
- 16.17 48.10
- 16.58 48.33
-
- lb
-
- image/jpeg
-
- google3857
-
-
-
-
-
-
-
-
- MZK Flächen
-
- 16.17 48.10
- 16.58 48.33
-
- fmzk
-
- image/jpeg
-
- google3857
-
-
-
-
-
-
-
-
- Flächenwidmungs- und Bebauungsplan
-
- 16.17 48.10
- 16.58 48.33
-
- flwbplmzk
-
- image/jpeg
-
- google3857
-
-
-
-
-
-
-
-
- Beschriftung
-
- 16.17 48.10
- 16.58 48.33
-
- beschriftung
-
- image/png
-
- google3857
-
-
-
-
-
-
-
-
-
- google3857
-
- 1799448.394855 6124949.747770
- 1848250.442089 6162571.828177
-
- urn:ogc:def:crs:EPSG:6.18:3:3857
- urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible
-
- 0
- 559082264.029
- -20037508.3428 20037508.3428
- 256
- 256
- 1
- 1
-
-
- 1
- 279541132.015
- -20037508.3428 20037508.3428
- 256
- 256
- 2
- 2
-
-
- 2
- 139770566.007
- -20037508.3428 20037508.3428
- 256
- 256
- 4
- 4
-
-
- 3
- 69885283.0036
- -20037508.3428 20037508.3428
- 256
- 256
- 8
- 8
-
-
- 4
- 34942641.5018
- -20037508.3428 20037508.3428
- 256
- 256
- 16
- 16
-
-
- 5
- 17471320.7509
- -20037508.3428 20037508.3428
- 256
- 256
- 32
- 32
-
-
- 6
- 8735660.37545
- -20037508.3428 20037508.3428
- 256
- 256
- 64
- 64
-
-
- 7
- 4367830.18773
- -20037508.3428 20037508.3428
- 256
- 256
- 128
- 128
-
-
- 8
- 2183915.09386
- -20037508.3428 20037508.3428
- 256
- 256
- 256
- 256
-
-
- 9
- 1091957.54693
- -20037508.3428 20037508.3428
- 256
- 256
- 512
- 512
-
-
- 10
- 545978.773466
- -20037508.3428 20037508.3428
- 256
- 256
- 1024
- 1024
-
-
- 11
- 272989.386733
- -20037508.3428 20037508.3428
- 256
- 256
- 2048
- 2048
-
-
- 12
- 136494.693366
- -20037508.3428 20037508.3428
- 256
- 256
- 4096
- 4096
-
-
- 13
- 68247.3466832
- -20037508.3428 20037508.3428
- 256
- 256
- 8192
- 8192
-
-
- 14
- 34123.6733416
- -20037508.3428 20037508.3428
- 256
- 256
- 16384
- 16384
-
-
- 15
- 17061.8366708
- -20037508.3428 20037508.3428
- 256
- 256
- 32768
- 32768
-
-
- 16
- 8530.91833540
- -20037508.3428 20037508.3428
- 256
- 256
- 65536
- 65536
-
-
- 17
- 4265.45916770
- -20037508.3428 20037508.3428
- 256
- 256
- 131072
- 131072
-
-
- 18
- 2132.72958385
- -20037508.3428 20037508.3428
- 256
- 256
- 262144
- 262144
-
-
- 19
- 1066.36479193
- -20037508.3428 20037508.3428
- 256
- 256
- 524288
- 524288
-
-
-
-
+
+ Web Map Tile Service - GeoWebCache
+ OGC WMTS
+ 1.0.0
+
+
+ http://sdi.georchestra.org/geoserver/gwc/service/wmts
+
+
+ GeoWebCache User
+
+
+
+
+
+
+
+
+
+ KVP
+
+
+
+
+
+
+
+
+
+
+
+
+ KVP
+
+
+
+
+
+
+
+
+
+
+
+
+ KVP
+
+
+
+
+
+
+
+
+
+ Ocean Bottom
+ Blended depth colors and relief shading of the ocean bottom derived from CleanTOPO2 data. The ocean color extends beneath land areas as a flat tint—mask it with the 10m Natural Earth vector shoreline, or a shoreline from another data source.
+
+ -179.99999999999986 -60.002328474493446
+ 179.98782010582556 60.000000000002935
+
+ dem:oceanbottom
+
+ image/jpeg
+ text/plain
+ application/vnd.ogc.gml
+ application/vnd.ogc.gml/3.1.1
+ text/html
+ application/json
+
+ EPSG:4326
+
+
+ EPSG:4326:0
+ 0
+ 0
+ 0
+ 1
+
+
+ EPSG:4326:1
+ 0
+ 1
+ 0
+ 3
+
+
+ EPSG:4326:2
+ 0
+ 3
+ 0
+ 7
+
+
+ EPSG:4326:3
+ 1
+ 6
+ 0
+ 15
+
+
+ EPSG:4326:4
+ 2
+ 13
+ 0
+ 31
+
+
+ EPSG:4326:5
+ 5
+ 26
+ 0
+ 63
+
+
+ EPSG:4326:6
+ 10
+ 53
+ 0
+ 127
+
+
+ EPSG:4326:7
+ 21
+ 106
+ 0
+ 255
+
+
+ EPSG:4326:8
+ 42
+ 213
+ 0
+ 511
+
+
+ EPSG:4326:9
+ 85
+ 426
+ 0
+ 1023
+
+
+ EPSG:4326:10
+ 170
+ 853
+ 0
+ 2047
+
+
+ EPSG:4326:11
+ 341
+ 1706
+ 0
+ 4095
+
+
+ EPSG:4326:12
+ 682
+ 3413
+ 0
+ 8191
+
+
+ EPSG:4326:13
+ 1365
+ 6826
+ 0
+ 16383
+
+
+ EPSG:4326:14
+ 2730
+ 13653
+ 0
+ 32766
+
+
+ EPSG:4326:15
+ 5461
+ 27307
+ 0
+ 65533
+
+
+ EPSG:4326:16
+ 10922
+ 54614
+ 0
+ 131067
+
+
+ EPSG:4326:17
+ 21845
+ 109228
+ 0
+ 262135
+
+
+ EPSG:4326:18
+ 43690
+ 218456
+ 0
+ 524270
+
+
+ EPSG:4326:19
+ 87381
+ 436913
+ 0
+ 1048540
+
+
+ EPSG:4326:20
+ 174762
+ 873826
+ 0
+ 2097081
+
+
+ EPSG:4326:21
+ 349525
+ 1747653
+ 0
+ 4194162
+
+
+
+
+ EPSG:3857
+
+
+ EPSG:3857:0
+ 0
+ 0
+ 0
+ 0
+
+
+ EPSG:3857:1
+ 0
+ 1
+ 0
+ 1
+
+
+ EPSG:3857:2
+ 1
+ 2
+ 0
+ 3
+
+
+ EPSG:3857:3
+ 2
+ 5
+ 0
+ 7
+
+
+ EPSG:3857:4
+ 4
+ 11
+ 0
+ 15
+
+
+ EPSG:3857:5
+ 9
+ 22
+ 0
+ 31
+
+
+ EPSG:3857:6
+ 18
+ 45
+ 0
+ 63
+
+
+ EPSG:3857:7
+ 37
+ 90
+ 0
+ 127
+
+
+ EPSG:3857:8
+ 74
+ 181
+ 0
+ 255
+
+
+ EPSG:3857:9
+ 148
+ 363
+ 0
+ 511
+
+
+ EPSG:3857:10
+ 297
+ 726
+ 0
+ 1023
+
+
+ EPSG:3857:11
+ 594
+ 1453
+ 0
+ 2047
+
+
+ EPSG:3857:12
+ 1189
+ 2906
+ 0
+ 4095
+
+
+ EPSG:3857:13
+ 2379
+ 5814
+ 0
+ 8191
+
+
+ EPSG:3857:14
+ 4758
+ 11627
+ 0
+ 16383
+
+
+ EPSG:3857:15
+ 9516
+ 23253
+ 0
+ 32766
+
+
+ EPSG:3857:16
+ 19032
+ 46506
+ 0
+ 65533
+
+
+ EPSG:3857:17
+ 38064
+ 93011
+ 0
+ 131067
+
+
+ EPSG:3857:18
+ 76127
+ 186021
+ 0
+ 262135
+
+
+ EPSG:3857:19
+ 152254
+ 372043
+ 0
+ 524271
+
+
+ EPSG:3857:20
+ 304507
+ 744085
+ 0
+ 1048542
+
+
+ EPSG:3857:21
+ 609014
+ 1488170
+ 0
+ 2097085
+
+
+
+
+
+ Altitude : shaded relief
+ Shaded relief from CGIAR DEM 3" resolution. Process mixes gdaldem hillshade and slope.
+
+ -180.0 -90.0
+ 180.0 90.0
+
+ dem:hillshading
+
+ image/jpeg
+
+ EPSG:4326
+
+
+ EPSG:3857
+
+
+ EPSG:3857:0
+ 0
+ 0
+ 0
+ 0
+
+
+ EPSG:3857:1
+ 0
+ 1
+ 0
+ 1
+
+
+ EPSG:3857:2
+ 1
+ 2
+ 0
+ 3
+
+
+ EPSG:3857:3
+ 2
+ 5
+ 0
+ 7
+
+
+ EPSG:3857:4
+ 4
+ 11
+ 0
+ 15
+
+
+ EPSG:3857:5
+ 9
+ 22
+ 0
+ 31
+
+
+ EPSG:3857:6
+ 18
+ 44
+ 0
+ 63
+
+
+ EPSG:3857:7
+ 37
+ 88
+ 0
+ 127
+
+
+ EPSG:3857:8
+ 74
+ 176
+ 0
+ 255
+
+
+ EPSG:3857:9
+ 148
+ 352
+ 0
+ 511
+
+
+ EPSG:3857:10
+ 297
+ 705
+ 0
+ 1023
+
+
+ EPSG:3857:11
+ 594
+ 1410
+ 0
+ 2047
+
+
+ EPSG:3857:12
+ 1189
+ 2821
+ 0
+ 4095
+
+
+ EPSG:3857:13
+ 2379
+ 5644
+ 0
+ 8191
+
+
+ EPSG:3857:14
+ 4758
+ 11287
+ 0
+ 16383
+
+
+ EPSG:3857:15
+ 9516
+ 22573
+ 0
+ 32767
+
+
+ EPSG:3857:16
+ 19032
+ 45146
+ 0
+ 65535
+
+
+ EPSG:3857:17
+ 38064
+ 90292
+ 0
+ 131071
+
+
+ EPSG:3857:18
+ 76127
+ 180584
+ 0
+ 262143
+
+
+ EPSG:3857:19
+ 152254
+ 361168
+ 0
+ 524287
+
+
+ EPSG:3857:20
+ 304507
+ 722336
+ 0
+ 1048575
+
+
+ EPSG:3857:21
+ 609014
+ 1444672
+ 0
+ 2097151
+
+
+
+
+
+ Altitude : color and shaded relief
+ Altitude map derived from a 3" DEM (90m on equator) covering latitudes from -90S to +60N. Jarvis A., H.I. Reuter, A. Nelson, E. Guevara, 2008, Hole-filled seamless SRTM data V4, International Centre for Tropical Agriculture (CIAT), available from http://srtm.csi.cgiar.org.
+
+ -180.0 -60.0
+ 180.0 60.0
+
+ dem:altitude
+
+ image/jpeg
+
+ EPSG:4326
+
+
+ EPSG:4326:0
+ 0
+ 0
+ 0
+ 1
+
+
+ EPSG:4326:1
+ 0
+ 1
+ 0
+ 3
+
+
+ EPSG:4326:2
+ 0
+ 3
+ 0
+ 7
+
+
+ EPSG:4326:3
+ 1
+ 6
+ 0
+ 15
+
+
+ EPSG:4326:4
+ 2
+ 13
+ 0
+ 31
+
+
+ EPSG:4326:5
+ 5
+ 26
+ 0
+ 63
+
+
+ EPSG:4326:6
+ 10
+ 53
+ 0
+ 127
+
+
+ EPSG:4326:7
+ 21
+ 106
+ 0
+ 255
+
+
+ EPSG:4326:8
+ 42
+ 213
+ 0
+ 511
+
+
+ EPSG:4326:9
+ 85
+ 426
+ 0
+ 1023
+
+
+ EPSG:4326:10
+ 170
+ 853
+ 0
+ 2047
+
+
+ EPSG:4326:11
+ 341
+ 1706
+ 0
+ 4095
+
+
+ EPSG:4326:12
+ 682
+ 3413
+ 0
+ 8191
+
+
+ EPSG:4326:13
+ 1365
+ 6826
+ 0
+ 16383
+
+
+ EPSG:4326:14
+ 2730
+ 13653
+ 0
+ 32767
+
+
+ EPSG:4326:15
+ 5461
+ 27306
+ 0
+ 65535
+
+
+ EPSG:4326:16
+ 10922
+ 54613
+ 0
+ 131071
+
+
+ EPSG:4326:17
+ 21845
+ 109226
+ 0
+ 262143
+
+
+ EPSG:4326:18
+ 43690
+ 218453
+ 0
+ 524287
+
+
+ EPSG:4326:19
+ 87381
+ 436906
+ 0
+ 1048575
+
+
+ EPSG:4326:20
+ 174762
+ 873813
+ 0
+ 2097151
+
+
+ EPSG:4326:21
+ 349525
+ 1747626
+ 0
+ 4194303
+
+
+
+
+ EPSG:3857
+
+
+ EPSG:3857:0
+ 0
+ 0
+ 0
+ 0
+
+
+ EPSG:3857:1
+ 0
+ 1
+ 0
+ 1
+
+
+ EPSG:3857:2
+ 1
+ 2
+ 0
+ 3
+
+
+ EPSG:3857:3
+ 2
+ 5
+ 0
+ 7
+
+
+ EPSG:3857:4
+ 4
+ 11
+ 0
+ 15
+
+
+ EPSG:3857:5
+ 9
+ 22
+ 0
+ 31
+
+
+ EPSG:3857:6
+ 18
+ 45
+ 0
+ 63
+
+
+ EPSG:3857:7
+ 37
+ 90
+ 0
+ 127
+
+
+ EPSG:3857:8
+ 74
+ 181
+ 0
+ 255
+
+
+ EPSG:3857:9
+ 148
+ 363
+ 0
+ 511
+
+
+ EPSG:3857:10
+ 297
+ 726
+ 0
+ 1023
+
+
+ EPSG:3857:11
+ 594
+ 1453
+ 0
+ 2047
+
+
+ EPSG:3857:12
+ 1189
+ 2906
+ 0
+ 4095
+
+
+ EPSG:3857:13
+ 2379
+ 5814
+ 0
+ 8191
+
+
+ EPSG:3857:14
+ 4758
+ 11627
+ 0
+ 16383
+
+
+ EPSG:3857:15
+ 9516
+ 23253
+ 0
+ 32767
+
+
+ EPSG:3857:16
+ 19032
+ 46505
+ 0
+ 65535
+
+
+ EPSG:3857:17
+ 38064
+ 93009
+ 0
+ 131071
+
+
+ EPSG:3857:18
+ 76127
+ 186018
+ 0
+ 262143
+
+
+ EPSG:3857:19
+ 152254
+ 372036
+ 0
+ 524287
+
+
+ EPSG:3857:20
+ 304507
+ 744072
+ 0
+ 1048575
+
+
+ EPSG:3857:21
+ 609014
+ 1488143
+ 0
+ 2097151
+
+
+
+
+
+ Earth at night 2012
+ This new global view and animation of Earth's city lights is a composite assembled from data acquired by the Suomi NPP satellite. The data was acquired over nine days in April 2012 and 13 days in October 2012. It took 312 orbits to get a clear shot of every parcel of Earth's land surface and islands. This new data was then mapped over existing Blue Marble imagery of Earth to provide a realistic view of the planet.
+
+ -180.0 -90.0
+ 180.0 90.0
+
+ nasa:night_2012
+
+ image/png8
+ text/plain
+ application/vnd.ogc.gml
+ application/vnd.ogc.gml/3.1.1
+ text/html
+ application/json
+
+ EPSG:4326
+
+
+ EPSG:3857
+
+
+
+ True Marble
+ A 250m res. global image composited from LandSat7 (1999-2002). True Marble by Unearthed Outdoors, LLC is licensed under a Creative Commons Attribution 3.0 United States License.
+
+ -180.0 -90.0
+ 180.0 90.0
+
+ unearthedoutdoors:truemarble
+
+ image/jpeg
+ text/plain
+ application/vnd.ogc.gml
+ application/vnd.ogc.gml/3.1.1
+ text/html
+ application/json
+
+ EPSG:4326
+
+
+ EPSG:3857
+
+
+
+ Altitude : digital elevation model
+ DEM 3" resolution (90m on equator) covering latitudes from -90S to +60N. Jarvis A., H.I. Reuter, A. Nelson, E. Guevara, 2008, Hole-filled seamless SRTM data V4, International Centre for Tropical Agriculture (CIAT), available from http://srtm.csi.cgiar.org.
+
+ -180.0 -90.0
+ 180.0 90.0
+
+ dem:srtm
+
+
+
+ image/jpeg
+ text/plain
+ application/vnd.ogc.gml
+ application/vnd.ogc.gml/3.1.1
+ text/html
+ application/json
+
+ EPSG:4326
+
+
+ EPSG:3857
+
+
+ EPSG:3857:0
+ 0
+ 0
+ 0
+ 0
+
+
+ EPSG:3857:1
+ 0
+ 1
+ 0
+ 1
+
+
+ EPSG:3857:2
+ 1
+ 2
+ 0
+ 3
+
+
+ EPSG:3857:3
+ 2
+ 5
+ 0
+ 7
+
+
+ EPSG:3857:4
+ 4
+ 11
+ 0
+ 15
+
+
+ EPSG:3857:5
+ 9
+ 22
+ 0
+ 31
+
+
+ EPSG:3857:6
+ 18
+ 45
+ 0
+ 63
+
+
+ EPSG:3857:7
+ 37
+ 90
+ 0
+ 127
+
+
+ EPSG:3857:8
+ 74
+ 181
+ 0
+ 255
+
+
+ EPSG:3857:9
+ 148
+ 363
+ 0
+ 511
+
+
+ EPSG:3857:10
+ 297
+ 726
+ 0
+ 1023
+
+
+ EPSG:3857:11
+ 594
+ 1453
+ 0
+ 2047
+
+
+ EPSG:3857:12
+ 1189
+ 2906
+ 0
+ 4095
+
+
+ EPSG:3857:13
+ 2379
+ 5814
+ 0
+ 8191
+
+
+ EPSG:3857:14
+ 4758
+ 11627
+ 0
+ 16383
+
+
+ EPSG:3857:15
+ 9516
+ 23253
+ 0
+ 32767
+
+
+ EPSG:3857:16
+ 19032
+ 46505
+ 0
+ 65535
+
+
+ EPSG:3857:17
+ 38064
+ 93009
+ 0
+ 131071
+
+
+ EPSG:3857:18
+ 76127
+ 186018
+ 0
+ 262143
+
+
+ EPSG:3857:19
+ 152254
+ 372036
+ 0
+ 524287
+
+
+ EPSG:3857:20
+ 304507
+ 744072
+ 0
+ 1048575
+
+
+ EPSG:3857:21
+ 609014
+ 1488143
+ 0
+ 2097151
+
+
+
+
+
+ GlobalCRS84Scale
+ urn:ogc:def:crs:EPSG::4326
+
+ GlobalCRS84Scale:0
+ 5.0E8
+ 90.0 -180.0
+ 256
+ 256
+ 2
+ 1
+
+
+ GlobalCRS84Scale:1
+ 2.5E8
+ 90.0 -180.0
+ 256
+ 256
+ 3
+ 2
+
+
+ GlobalCRS84Scale:2
+ 1.0E8
+ 90.0 -180.0
+ 256
+ 256
+ 6
+ 3
+
+
+ GlobalCRS84Scale:3
+ 5.0E7
+ 90.0 -180.0
+ 256
+ 256
+ 12
+ 6
+
+
+ GlobalCRS84Scale:4
+ 2.5E7
+ 90.0 -180.0
+ 256
+ 256
+ 23
+ 12
+
+
+ GlobalCRS84Scale:5
+ 1.0E7
+ 90.0 -180.0
+ 256
+ 256
+ 56
+ 28
+
+
+ GlobalCRS84Scale:6
+ 5000000.0
+ 90.0 -180.0
+ 256
+ 256
+ 112
+ 56
+
+
+ GlobalCRS84Scale:7
+ 2500000.0
+ 90.0 -180.0
+ 256
+ 256
+ 224
+ 112
+
+
+ GlobalCRS84Scale:8
+ 1000000.0
+ 90.0 -180.0
+ 256
+ 256
+ 560
+ 280
+
+
+ GlobalCRS84Scale:9
+ 500000.0
+ 90.0 -180.0
+ 256
+ 256
+ 1119
+ 560
+
+
+ GlobalCRS84Scale:10
+ 250000.0
+ 90.0 -180.0
+ 256
+ 256
+ 2237
+ 1119
+
+
+ GlobalCRS84Scale:11
+ 100000.0
+ 90.0 -180.0
+ 256
+ 256
+ 5591
+ 2796
+
+
+ GlobalCRS84Scale:12
+ 50000.0
+ 90.0 -180.0
+ 256
+ 256
+ 11182
+ 5591
+
+
+ GlobalCRS84Scale:13
+ 25000.0
+ 90.0 -180.0
+ 256
+ 256
+ 22364
+ 11182
+
+
+ GlobalCRS84Scale:14
+ 10000.0
+ 90.0 -180.0
+ 256
+ 256
+ 55909
+ 27955
+
+
+ GlobalCRS84Scale:15
+ 5000.0
+ 90.0 -180.0
+ 256
+ 256
+ 111817
+ 55909
+
+
+ GlobalCRS84Scale:16
+ 2500.0
+ 90.0 -180.0
+ 256
+ 256
+ 223633
+ 111817
+
+
+ GlobalCRS84Scale:17
+ 1000.0
+ 90.0 -180.0
+ 256
+ 256
+ 559083
+ 279542
+
+
+ GlobalCRS84Scale:18
+ 500.0
+ 90.0 -180.0
+ 256
+ 256
+ 1118165
+ 559083
+
+
+ GlobalCRS84Scale:19
+ 250.0
+ 90.0 -180.0
+ 256
+ 256
+ 2236330
+ 1118165
+
+
+ GlobalCRS84Scale:20
+ 100.0
+ 90.0 -180.0
+ 256
+ 256
+ 5590823
+ 2795412
+
+
+
+ EPSG:4326
+ urn:ogc:def:crs:EPSG::4326
+
+ EPSG:4326:0
+ 2.795411320143589E8
+ 90.0 -180.0
+ 256
+ 256
+ 2
+ 1
+
+
+ EPSG:4326:1
+ 1.3977056600717944E8
+ 90.0 -180.0
+ 256
+ 256
+ 4
+ 2
+
+
+ EPSG:4326:2
+ 6.988528300358972E7
+ 90.0 -180.0
+ 256
+ 256
+ 8
+ 4
+
+
+ EPSG:4326:3
+ 3.494264150179486E7
+ 90.0 -180.0
+ 256
+ 256
+ 16
+ 8
+
+
+ EPSG:4326:4
+ 1.747132075089743E7
+ 90.0 -180.0
+ 256
+ 256
+ 32
+ 16
+
+
+ EPSG:4326:5
+ 8735660.375448715
+ 90.0 -180.0
+ 256
+ 256
+ 64
+ 32
+
+
+ EPSG:4326:6
+ 4367830.1877243575
+ 90.0 -180.0
+ 256
+ 256
+ 128
+ 64
+
+
+ EPSG:4326:7
+ 2183915.0938621787
+ 90.0 -180.0
+ 256
+ 256
+ 256
+ 128
+
+
+ EPSG:4326:8
+ 1091957.5469310894
+ 90.0 -180.0
+ 256
+ 256
+ 512
+ 256
+
+
+ EPSG:4326:9
+ 545978.7734655447
+ 90.0 -180.0
+ 256
+ 256
+ 1024
+ 512
+
+
+ EPSG:4326:10
+ 272989.38673277234
+ 90.0 -180.0
+ 256
+ 256
+ 2048
+ 1024
+
+
+ EPSG:4326:11
+ 136494.69336638617
+ 90.0 -180.0
+ 256
+ 256
+ 4096
+ 2048
+
+
+ EPSG:4326:12
+ 68247.34668319309
+ 90.0 -180.0
+ 256
+ 256
+ 8192
+ 4096
+
+
+ EPSG:4326:13
+ 34123.67334159654
+ 90.0 -180.0
+ 256
+ 256
+ 16384
+ 8192
+
+
+ EPSG:4326:14
+ 17061.83667079827
+ 90.0 -180.0
+ 256
+ 256
+ 32768
+ 16384
+
+
+ EPSG:4326:15
+ 8530.918335399136
+ 90.0 -180.0
+ 256
+ 256
+ 65536
+ 32768
+
+
+ EPSG:4326:16
+ 4265.459167699568
+ 90.0 -180.0
+ 256
+ 256
+ 131072
+ 65536
+
+
+ EPSG:4326:17
+ 2132.729583849784
+ 90.0 -180.0
+ 256
+ 256
+ 262144
+ 131072
+
+
+ EPSG:4326:18
+ 1066.364791924892
+ 90.0 -180.0
+ 256
+ 256
+ 524288
+ 262144
+
+
+ EPSG:4326:19
+ 533.182395962446
+ 90.0 -180.0
+ 256
+ 256
+ 1048576
+ 524288
+
+
+ EPSG:4326:20
+ 266.591197981223
+ 90.0 -180.0
+ 256
+ 256
+ 2097152
+ 1048576
+
+
+ EPSG:4326:21
+ 133.2955989906115
+ 90.0 -180.0
+ 256
+ 256
+ 4194304
+ 2097152
+
+
+
+ GoogleCRS84Quad
+ urn:ogc:def:crs:EPSG::4326
+
+ GoogleCRS84Quad:0
+ 5.590822640287178E8
+ 90.0 -180.0
+ 256
+ 256
+ 1
+ 1
+
+
+ GoogleCRS84Quad:1
+ 2.795411320143589E8
+ 90.0 -180.0
+ 256
+ 256
+ 2
+ 1
+
+
+ GoogleCRS84Quad:2
+ 1.397705660071794E8
+ 90.0 -180.0
+ 256
+ 256
+ 4
+ 2
+
+
+ GoogleCRS84Quad:3
+ 6.988528300358972E7
+ 90.0 -180.0
+ 256
+ 256
+ 8
+ 4
+
+
+ GoogleCRS84Quad:4
+ 3.494264150179486E7
+ 90.0 -180.0
+ 256
+ 256
+ 16
+ 8
+
+
+ GoogleCRS84Quad:5
+ 1.747132075089743E7
+ 90.0 -180.0
+ 256
+ 256
+ 32
+ 16
+
+
+ GoogleCRS84Quad:6
+ 8735660.375448715
+ 90.0 -180.0
+ 256
+ 256
+ 64
+ 32
+
+
+ GoogleCRS84Quad:7
+ 4367830.187724357
+ 90.0 -180.0
+ 256
+ 256
+ 128
+ 64
+
+
+ GoogleCRS84Quad:8
+ 2183915.093862179
+ 90.0 -180.0
+ 256
+ 256
+ 256
+ 128
+
+
+ GoogleCRS84Quad:9
+ 1091957.546931089
+ 90.0 -180.0
+ 256
+ 256
+ 512
+ 256
+
+
+ GoogleCRS84Quad:10
+ 545978.7734655447
+ 90.0 -180.0
+ 256
+ 256
+ 1024
+ 512
+
+
+ GoogleCRS84Quad:11
+ 272989.3867327723
+ 90.0 -180.0
+ 256
+ 256
+ 2048
+ 1024
+
+
+ GoogleCRS84Quad:12
+ 136494.6933663862
+ 90.0 -180.0
+ 256
+ 256
+ 4096
+ 2048
+
+
+ GoogleCRS84Quad:13
+ 68247.34668319309
+ 90.0 -180.0
+ 256
+ 256
+ 8192
+ 4096
+
+
+ GoogleCRS84Quad:14
+ 34123.67334159654
+ 90.0 -180.0
+ 256
+ 256
+ 16384
+ 8192
+
+
+ GoogleCRS84Quad:15
+ 17061.83667079827
+ 90.0 -180.0
+ 256
+ 256
+ 32768
+ 16384
+
+
+ GoogleCRS84Quad:16
+ 8530.918335399136
+ 90.0 -180.0
+ 256
+ 256
+ 65536
+ 32768
+
+
+ GoogleCRS84Quad:17
+ 4265.459167699568
+ 90.0 -180.0
+ 256
+ 256
+ 131072
+ 65536
+
+
+ GoogleCRS84Quad:18
+ 2132.729583849784
+ 90.0 -180.0
+ 256
+ 256
+ 262144
+ 131072
+
+
+
+ EPSG:900913
+ urn:ogc:def:crs:EPSG::900913
+
+ EPSG:900913:0
+ 5.590822639508929E8
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 1
+ 1
+
+
+ EPSG:900913:1
+ 2.7954113197544646E8
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 2
+ 2
+
+
+ EPSG:900913:2
+ 1.3977056598772323E8
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 4
+ 4
+
+
+ EPSG:900913:3
+ 6.988528299386162E7
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 8
+ 8
+
+
+ EPSG:900913:4
+ 3.494264149693081E7
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 16
+ 16
+
+
+ EPSG:900913:5
+ 1.7471320748465404E7
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 32
+ 32
+
+
+ EPSG:900913:6
+ 8735660.374232702
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 64
+ 64
+
+
+ EPSG:900913:7
+ 4367830.187116351
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 128
+ 128
+
+
+ EPSG:900913:8
+ 2183915.0935581755
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 256
+ 256
+
+
+ EPSG:900913:9
+ 1091957.5467790877
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 512
+ 512
+
+
+ EPSG:900913:10
+ 545978.7733895439
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 1024
+ 1024
+
+
+ EPSG:900913:11
+ 272989.38669477194
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 2048
+ 2048
+
+
+ EPSG:900913:12
+ 136494.69334738597
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 4096
+ 4096
+
+
+ EPSG:900913:13
+ 68247.34667369298
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 8192
+ 8192
+
+
+ EPSG:900913:14
+ 34123.67333684649
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 16384
+ 16384
+
+
+ EPSG:900913:15
+ 17061.836668423246
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 32768
+ 32768
+
+
+ EPSG:900913:16
+ 8530.918334211623
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 65536
+ 65536
+
+
+ EPSG:900913:17
+ 4265.4591671058115
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 131072
+ 131072
+
+
+ EPSG:900913:18
+ 2132.7295835529058
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 262144
+ 262144
+
+
+ EPSG:900913:19
+ 1066.3647917764529
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 524288
+ 524288
+
+
+ EPSG:900913:20
+ 533.1823958882264
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 1048576
+ 1048576
+
+
+ EPSG:900913:21
+ 266.5911979441132
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 2097152
+ 2097152
+
+
+ EPSG:900913:22
+ 133.2955989720566
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 4194304
+ 4194304
+
+
+ EPSG:900913:23
+ 66.6477994860283
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 8388608
+ 8388608
+
+
+ EPSG:900913:24
+ 33.32389974301415
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 16777216
+ 16777216
+
+
+ EPSG:900913:25
+ 16.661949871507076
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 33554432
+ 33554432
+
+
+ EPSG:900913:26
+ 8.330974935753538
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 67108864
+ 67108864
+
+
+ EPSG:900913:27
+ 4.165487467876769
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 134217728
+ 134217728
+
+
+ EPSG:900913:28
+ 2.0827437339383845
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 268435456
+ 268435456
+
+
+ EPSG:900913:29
+ 1.0413718669691923
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 536870912
+ 536870912
+
+
+ EPSG:900913:30
+ 0.5206859334845961
+ -2.003750834E7 2.0037508E7
+ 256
+ 256
+ 1073741824
+ 1073741824
+
+
+
+ EPSG:3857
+ urn:ogc:def:crs:EPSG::3857
+
+ EPSG:3857:0
+ 5.590811457640435E8
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 1
+ 1
+
+
+ EPSG:3857:1
+ 2.795405728820217E8
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 2
+ 2
+
+
+ EPSG:3857:2
+ 1.3977028644101086E8
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 4
+ 4
+
+
+ EPSG:3857:3
+ 6.988514322050543E7
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 8
+ 8
+
+
+ EPSG:3857:4
+ 3.4942571610252716E7
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 16
+ 16
+
+
+ EPSG:3857:5
+ 1.7471285805126358E7
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 32
+ 32
+
+
+ EPSG:3857:6
+ 8735642.902563179
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 64
+ 64
+
+
+ EPSG:3857:7
+ 4367821.451281589
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 128
+ 128
+
+
+ EPSG:3857:8
+ 2183910.7256407947
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 256
+ 256
+
+
+ EPSG:3857:9
+ 1091955.3628203974
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 512
+ 512
+
+
+ EPSG:3857:10
+ 545977.6814101987
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 1024
+ 1024
+
+
+ EPSG:3857:11
+ 272988.84070509934
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 2048
+ 2048
+
+
+ EPSG:3857:12
+ 136494.42035254967
+ -2.003750834E7 2.0037428E7
+ 256
+ 256
+ 4096
+ 4096
+
+
+ EPSG:3857:13
+ 68247.21017627484
+ -2.003750834E7 2.004232E7
+ 256
+ 256
+ 8193
+ 8193
+
+
+ EPSG:3857:14
+ 34123.60508813742
+ -2.003750834E7 2.0039874E7
+ 256
+ 256
+ 16385
+ 16385
+
+
+ EPSG:3857:15
+ 17061.80254406871
+ -2.003750834E7 2.0038651E7
+ 256
+ 256
+ 32769
+ 32769
+
+
+ EPSG:3857:16
+ 8530.901272034354
+ -2.003750834E7 2.003804E7
+ 256
+ 256
+ 65537
+ 65537
+
+
+ EPSG:3857:17
+ 4265.450636017177
+ -2.003750834E7 2.0037734E7
+ 256
+ 256
+ 131073
+ 131073
+
+
+ EPSG:3857:18
+ 2132.7253180085886
+ -2.003750834E7 2.0037581E7
+ 256
+ 256
+ 262145
+ 262145
+
+
+ EPSG:3857:19
+ 1066.3626590042943
+ -2.003750834E7 2.0037581E7
+ 256
+ 256
+ 524290
+ 524290
+
+
+ EPSG:3857:20
+ 533.1813295021472
+ -2.003750834E7 2.0037543E7
+ 256
+ 256
+ 1048579
+ 1048579
+
+
+ EPSG:3857:21
+ 266.5906647510736
+ -2.003750834E7 2.0037524E7
+ 256
+ 256
+ 2097157
+ 2097157
+
+
+
+ GlobalCRS84Pixel
+ urn:ogc:def:crs:EPSG::4326
+
+ GlobalCRS84Pixel:0
+ 7.951392199519542E8
+ 90.0 -180.0
+ 256
+ 256
+ 1
+ 1
+
+
+ GlobalCRS84Pixel:1
+ 3.975696099759771E8
+ 90.0 -180.0
+ 256
+ 256
+ 2
+ 1
+
+
+ GlobalCRS84Pixel:2
+ 1.9878480498798856E8
+ 90.0 -180.0
+ 256
+ 256
+ 3
+ 2
+
+
+ GlobalCRS84Pixel:3
+ 1.325232033253257E8
+ 90.0 -180.0
+ 256
+ 256
+ 5
+ 3
+
+
+ GlobalCRS84Pixel:4
+ 6.626160166266285E7
+ 90.0 -180.0
+ 256
+ 256
+ 9
+ 5
+
+
+ GlobalCRS84Pixel:5
+ 3.3130800831331424E7
+ 90.0 -180.0
+ 256
+ 256
+ 17
+ 9
+
+
+ GlobalCRS84Pixel:6
+ 1.325232033253257E7
+ 90.0 -180.0
+ 256
+ 256
+ 43
+ 22
+
+
+ GlobalCRS84Pixel:7
+ 6626160.166266285
+ 90.0 -180.0
+ 256
+ 256
+ 85
+ 43
+
+
+ GlobalCRS84Pixel:8
+ 3313080.0831331424
+ 90.0 -180.0
+ 256
+ 256
+ 169
+ 85
+
+
+ GlobalCRS84Pixel:9
+ 1656540.0415665712
+ 90.0 -180.0
+ 256
+ 256
+ 338
+ 169
+
+
+ GlobalCRS84Pixel:10
+ 552180.0138555238
+ 90.0 -180.0
+ 256
+ 256
+ 1013
+ 507
+
+
+ GlobalCRS84Pixel:11
+ 331308.00831331423
+ 90.0 -180.0
+ 256
+ 256
+ 1688
+ 844
+
+
+ GlobalCRS84Pixel:12
+ 110436.00277110476
+ 90.0 -180.0
+ 256
+ 256
+ 5063
+ 2532
+
+
+ GlobalCRS84Pixel:13
+ 55218.00138555238
+ 90.0 -180.0
+ 256
+ 256
+ 10125
+ 5063
+
+
+ GlobalCRS84Pixel:14
+ 33130.80083133143
+ 90.0 -180.0
+ 256
+ 256
+ 16875
+ 8438
+
+
+ GlobalCRS84Pixel:15
+ 11043.600277110474
+ 90.0 -180.0
+ 256
+ 256
+ 50625
+ 25313
+
+
+ GlobalCRS84Pixel:16
+ 3313.080083133142
+ 90.0 -180.0
+ 256
+ 256
+ 168750
+ 84375
+
+
+ GlobalCRS84Pixel:17
+ 1104.3600277110472
+ 90.0 -180.0
+ 256
+ 256
+ 506250
+ 253125
+
+
+
+
\ No newline at end of file
diff --git a/examples/wmts-capabilities.html b/examples/wmts-capabilities.html
new file mode 100644
index 0000000000..1a37d7784c
--- /dev/null
+++ b/examples/wmts-capabilities.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+ WMTS GetCapabilities parsing example
+
+
+
+
+
+
+
+
+
+
+
WMTS GetCapabilities parsing example
+
Example of parsing a WMTS GetCapabilities response.
+
+
wmts, capabilities, getcapabilities
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/wmts-capabilities.js b/examples/wmts-capabilities.js
new file mode 100644
index 0000000000..61f8820976
--- /dev/null
+++ b/examples/wmts-capabilities.js
@@ -0,0 +1,8 @@
+goog.require('ol.format.WMTSCapabilities');
+
+var parser = new ol.format.WMTSCapabilities();
+
+$.ajax('data/WMTSCapabilities.xml').then(function(response) {
+ var result = parser.read(response);
+ $('#log').html(window.JSON.stringify(result, null, 2));
+});
diff --git a/src/ol/format/owsformat.js b/src/ol/format/owsformat.js
index 59cc689d98..8bd7590045 100644
--- a/src/ol/format/owsformat.js
+++ b/src/ol/format/owsformat.js
@@ -83,20 +83,13 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
ol.format.OWS.readConstraint_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Constraint');
- var object = objectStack[objectStack.length - 1];
- goog.asserts.assert(goog.isObject(object));
var name = node.getAttribute('name');
- var value = ol.xml.pushParseAndPop({},
- ol.format.OWS.CONSTRAINT_PARSERS_, node,
- objectStack);
- if (!goog.isDef(value)) {
+ if (!goog.isDef(name)) {
return undefined;
}
- if (!goog.isDef(object.constraints)) {
- object.constraints = {};
- }
- object.constraints[name] = value;
-
+ return ol.xml.pushParseAndPop({'name': name},
+ ol.format.OWS.CONSTRAINT_PARSERS_, node,
+ objectStack);
};
@@ -137,22 +130,12 @@ ol.format.OWS.readDcp_ = function(node, objectStack) {
ol.format.OWS.readGet_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Get');
- var object = objectStack[objectStack.length - 1];
- var url = ol.format.XLink.readHref(node);
- goog.asserts.assert(goog.isObject(object));
- var value = ol.xml.pushParseAndPop({'url': url},
- ol.format.OWS.REQUEST_METHOD_PARSERS_, node, objectStack);
- if (!goog.isDef(value)) {
+ var href = ol.format.XLink.readHref(node);
+ if (!goog.isDef(href)) {
return undefined;
}
- var get = object['get'];
- if (!goog.isDef(get)) {
- object['get'] = [value];
- }else {
- goog.asserts.assert(goog.isArray(get));
- get.push(value);
- }
-
+ return ol.xml.pushParseAndPop({'href': href},
+ ol.format.OWS.REQUEST_METHOD_PARSERS_, node, objectStack);
};
@@ -273,18 +256,12 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @private
- * @return {Object|undefined}
+ * @return {string|undefined}
*/
ol.format.OWS.readValue_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Value');
- var object = objectStack[objectStack.length - 1];
- goog.asserts.assert(goog.isObject(object));
- var key = ol.format.XSD.readString(node);
- if (!goog.isDef(key)) {
- return undefined;
- }
- object[key] = true;
+ return ol.format.XSD.readString(node);
};
@@ -307,14 +284,11 @@ ol.format.OWS.NAMESPACE_URIS_ = [
ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
'ServiceIdentification': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readServiceIdentification_,
- 'serviceIdentification'),
+ ol.format.OWS.readServiceIdentification_),
'ServiceProvider': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readServiceProvider_,
- 'serviceProvider'),
+ ol.format.OWS.readServiceProvider_),
'OperationsMetadata': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readOperationsMetadata_,
- 'operationsMetadata')
+ ol.format.OWS.readOperationsMetadata_)
});
@@ -326,17 +300,14 @@ ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
'DeliveryPoint': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'deliveryPoint'),
- 'City': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'city'),
+ ol.format.XSD.readString),
+ 'City': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'AdministrativeArea': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'administrativeArea'),
- 'PostalCode': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'postalCode'),
- 'Country': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'country'),
+ ol.format.XSD.readString),
+ 'PostalCode': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
+ 'Country': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'ElectronicMailAddress': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'electronicMailAddress')
+ ol.format.XSD.readString)
});
@@ -347,7 +318,7 @@ ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'Value': ol.format.OWS.readValue_
+ 'Value': ol.xml.makeObjectPropertyPusher(ol.format.OWS.readValue_)
});
@@ -359,8 +330,7 @@ ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
'AllowedValues': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readAllowedValues_, 'allowedValues'
- )
+ ol.format.OWS.readAllowedValues_)
});
@@ -371,10 +341,8 @@ ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'Phone': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readPhone_, 'phone'),
- 'Address': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readAddress_, 'address')
+ 'Phone': ol.xml.makeObjectPropertySetter(ol.format.OWS.readPhone_),
+ 'Address': ol.xml.makeObjectPropertySetter(ol.format.OWS.readAddress_)
});
@@ -385,8 +353,7 @@ ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'HTTP': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readHttp_, 'http')
+ 'HTTP': ol.xml.makeObjectPropertySetter(ol.format.OWS.readHttp_)
});
@@ -397,7 +364,7 @@ ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'Get': ol.format.OWS.readGet_,
+ 'Get': ol.xml.makeObjectPropertyPusher(ol.format.OWS.readGet_),
'Post': undefined // TODO
});
@@ -409,8 +376,7 @@ ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.OPERATION_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'DCP': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readDcp_, 'dcp')
+ 'DCP': ol.xml.makeObjectPropertySetter(ol.format.OWS.readDcp_)
});
@@ -432,10 +398,8 @@ ol.format.OWS.OPERATIONS_METADATA_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'Voice': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'voice'),
- 'Facsimile': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'facsimile')
+ 'Voice': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
+ 'Facsimile': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString)
});
@@ -446,7 +410,8 @@ ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS(
*/
ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'Constraint': ol.format.OWS.readConstraint_
+ 'Constraint': ol.xml.makeObjectPropertyPusher(
+ ol.format.OWS.readConstraint_)
});
@@ -459,11 +424,10 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
'IndividualName': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'individualName'),
- 'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'positionName'),
+ ol.format.XSD.readString),
+ 'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'ContactInfo': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readContactInfo_, 'contactInfo')
+ ol.format.OWS.readContactInfo_)
});
@@ -475,12 +439,10 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'title'),
+ 'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'ServiceTypeVersion': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'serviceTypeVersion'),
- 'ServiceType': ol.xml.makeObjectPropertySetter(
- ol.format.XSD.readString, 'serviceType')
+ ol.format.XSD.readString),
+ 'ServiceType': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString)
});
@@ -492,10 +454,8 @@ ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
ol.format.OWS.SERVICE_PROVIDER_PARSERS_ =
ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, {
- 'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
- 'providerName'),
- 'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref,
- 'providerSite'),
+ 'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
+ 'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref),
'ServiceContact': ol.xml.makeObjectPropertySetter(
- ol.format.OWS.readServiceContact_, 'serviceContact')
+ ol.format.OWS.readServiceContact_)
});
diff --git a/src/ol/format/wmtscapabilitiesformat.js b/src/ol/format/wmtscapabilitiesformat.js
new file mode 100644
index 0000000000..ccaf9d5c99
--- /dev/null
+++ b/src/ol/format/wmtscapabilitiesformat.js
@@ -0,0 +1,400 @@
+goog.provide('ol.format.WMTSCapabilities');
+
+goog.require('goog.asserts');
+goog.require('goog.dom.NodeType');
+goog.require('goog.object');
+goog.require('goog.string');
+goog.require('ol.extent');
+goog.require('ol.format.OWS');
+goog.require('ol.format.XLink');
+goog.require('ol.format.XML');
+goog.require('ol.format.XSD');
+goog.require('ol.xml');
+
+
+
+/**
+ * @classdesc
+ * Format for reading WMTS capabilities data.
+ *
+ * @constructor
+ * @extends {ol.format.XML}
+ * @api
+ */
+ol.format.WMTSCapabilities = function() {
+ goog.base(this);
+
+ /**
+ * @type {ol.format.OWS}
+ * @private
+ */
+ this.owsParser_ = new ol.format.OWS();
+};
+goog.inherits(ol.format.WMTSCapabilities, ol.format.XML);
+
+
+/**
+ * Read a WMTS capabilities document.
+ *
+ * @function
+ * @param {Document|Node|string} source The XML source.
+ * @return {Object} An object representing the WMTS capabilities.
+ * @api
+ */
+ol.format.WMTSCapabilities.prototype.read;
+
+
+/**
+ * @param {Document} doc Document.
+ * @return {Object} WMTS Capability object.
+ */
+ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
+ goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT);
+ for (var n = doc.firstChild; !goog.isNull(n); n = n.nextSibling) {
+ if (n.nodeType == goog.dom.NodeType.ELEMENT) {
+ return this.readFromNode(n);
+ }
+ }
+ return null;
+};
+
+
+/**
+ * @param {Node} node Node.
+ * @return {Object} WMTS Capability object.
+ */
+ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
+ goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
+ goog.asserts.assert(node.localName == 'Capabilities');
+ this.version = goog.string.trim(node.getAttribute('version'));
+ goog.asserts.assertString(this.version);
+ var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
+ if (!goog.isDef(WMTSCapabilityObject)) {
+ return null;
+ }
+ goog.object.set(WMTSCapabilityObject, 'version', this.version);
+ WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
+ ol.format.WMTSCapabilities.PARSERS_, node, []);
+ return goog.isDef(WMTSCapabilityObject) ? WMTSCapabilityObject : null;
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Attribution object.
+ */
+ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
+ goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
+ goog.asserts.assert(node.localName == 'Contents');
+
+ return ol.xml.pushParseAndPop({},
+ ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Layers object.
+ */
+ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
+ goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
+ goog.asserts.assert(node.localName == 'Layer');
+ return ol.xml.pushParseAndPop({},
+ ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Tile Matrix Set object.
+ */
+ol.format.WMTSCapabilities.readTileMatrixSet_ = function(node, objectStack) {
+ return ol.xml.pushParseAndPop({},
+ ol.format.WMTSCapabilities.TMS_PARSERS_, node, objectStack);
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Style object.
+ */
+ol.format.WMTSCapabilities.readStyle_ = function(node, objectStack) {
+ var style = ol.xml.pushParseAndPop({},
+ ol.format.WMTSCapabilities.STYLE_PARSERS_, node, objectStack);
+ if (!goog.isDef(style)) {
+ return undefined;
+ }
+ var isDefault = node.getAttribute('isDefault') === 'true';
+ style['isDefault'] = isDefault;
+ return style;
+
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Tile Matrix Set Link object.
+ */
+ol.format.WMTSCapabilities.readTileMatrixSetLink_ = function(node,
+ objectStack) {
+ return ol.xml.pushParseAndPop({},
+ ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_, node, objectStack);
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Resource URL object.
+ */
+ol.format.WMTSCapabilities.readResourceUrl_ = function(node, objectStack) {
+ var format = node.getAttribute('format');
+ var template = node.getAttribute('template');
+ var resourceType = node.getAttribute('resourceType');
+ var resource = {};
+ if (goog.isDef(format)) {
+ resource['format'] = format;
+ }
+ if (goog.isDef(template)) {
+ resource['template'] = template;
+ }
+ if (goog.isDef(resourceType)) {
+ resource['resourceType'] = resourceType;
+ }
+ return resource;
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} WGS84 BBox object.
+ */
+ol.format.WMTSCapabilities.readWgs84BoundingBox_ = function(node, objectStack) {
+ var coordinates = ol.xml.pushParseAndPop([],
+ ol.format.WMTSCapabilities.WGS84_BBOX_READERS_, node, objectStack);
+ if (coordinates.length != 2) {
+ return undefined;
+ }
+ return ol.extent.boundingExtent(coordinates);
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Legend object.
+ */
+ol.format.WMTSCapabilities.readLegendUrl_ = function(node, objectStack) {
+ var legend = {};
+ legend['format'] = node.getAttribute('format');
+ legend['href'] = ol.format.XLink.readHref(node);
+ return legend;
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} Coordinates object.
+ */
+ol.format.WMTSCapabilities.readCoordinates_ = function(node, objectStack) {
+ var coordinates = ol.format.XSD.readString(node).split(' ');
+ if (!goog.isDef(coordinates) || coordinates.length != 2) {
+ return undefined;
+ }
+ var x = +coordinates[0];
+ var y = +coordinates[1];
+ if (isNaN(x) || isNaN(y)) {
+ return undefined;
+ }
+ return [x, y];
+};
+
+
+/**
+ * @private
+ * @param {Node} node Node.
+ * @param {Array.<*>} objectStack Object stack.
+ * @return {Object|undefined} TileMatrix object.
+ */
+ol.format.WMTSCapabilities.readTileMatrix_ = function(node, objectStack) {
+ return ol.xml.pushParseAndPop({},
+ ol.format.WMTSCapabilities.TM_PARSERS_, node, objectStack);
+};
+
+
+/**
+ * @const
+ * @private
+ * @type {Array.}
+ */
+ol.format.WMTSCapabilities.NAMESPACE_URIS_ = [
+ null,
+ 'http://www.opengis.net/wmts/1.0'
+];
+
+
+/**
+ * @const
+ * @private
+ * @type {Array.}
+ */
+ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_ = [
+ null,
+ 'http://www.opengis.net/ows/1.1'
+];
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'Contents': ol.xml.makeObjectPropertySetter(
+ ol.format.WMTSCapabilities.readContents_)
+ });
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.CONTENTS_PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'Layer': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readLayer_),
+ 'TileMatrixSet': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readTileMatrixSet_)
+ });
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.LAYER_PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'Style': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readStyle_),
+ 'Format': ol.xml.makeObjectPropertyPusher(
+ ol.format.XSD.readString),
+ 'TileMatrixSetLink': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readTileMatrixSetLink_),
+ 'ResourceURL': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readResourceUrl_)
+ }, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
+ 'Title': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString),
+ 'Abstract': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString),
+ 'WGS84BoundingBox': ol.xml.makeObjectPropertySetter(
+ ol.format.WMTSCapabilities.readWgs84BoundingBox_),
+ 'Identifier': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString)
+ }));
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.STYLE_PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'LegendURL': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readLegendUrl_)
+ }, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
+ 'Title': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString),
+ 'Identifier': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString)
+ }));
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'TileMatrixSet': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString)
+ });
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.WGS84_BBOX_READERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
+ 'LowerCorner': ol.xml.makeArrayPusher(
+ ol.format.WMTSCapabilities.readCoordinates_),
+ 'UpperCorner': ol.xml.makeArrayPusher(
+ ol.format.WMTSCapabilities.readCoordinates_)
+ });
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.TMS_PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'WellKnownScaleSet': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString),
+ 'TileMatrix': ol.xml.makeObjectPropertyPusher(
+ ol.format.WMTSCapabilities.readTileMatrix_)
+ }, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
+ 'SupportedCRS': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString),
+ 'Identifier': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString)
+ }));
+
+
+/**
+ * @const
+ * @type {Object.>}
+ * @private
+ */
+ol.format.WMTSCapabilities.TM_PARSERS_ = ol.xml.makeParsersNS(
+ ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
+ 'TopLeftCorner': ol.xml.makeObjectPropertySetter(
+ ol.format.WMTSCapabilities.readCoordinates_),
+ 'ScaleDenominator': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readDecimal),
+ 'TileWidth': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readNonNegativeInteger),
+ 'TileHeight': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readNonNegativeInteger),
+ 'MatrixWidth': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readNonNegativeInteger),
+ 'MatrixHeight': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readNonNegativeInteger)
+ }, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
+ 'Identifier': ol.xml.makeObjectPropertySetter(
+ ol.format.XSD.readString)
+ }));
diff --git a/test/spec/ol/format/owsformat.test.js b/test/spec/ol/format/owsformat.test.js
index 03adf24096..fa2be4a366 100644
--- a/test/spec/ol/format/owsformat.test.js
+++ b/test/spec/ol/format/owsformat.test.js
@@ -44,15 +44,15 @@ describe('ol.format.OWS 1.1', function() {
var obj = parser.read(doc);
expect(obj).to.be.ok();
- var serviceProvider = obj.serviceProvider;
+ var serviceProvider = obj.ServiceProvider;
expect(serviceProvider).to.be.ok();
- expect(serviceProvider.providerName).to.eql('MiraMon');
+ expect(serviceProvider.ProviderName).to.eql('MiraMon');
var url = 'http://www.creaf.uab.es/miramon';
- expect(serviceProvider.providerSite).to.eql(url);
+ expect(serviceProvider.ProviderSite).to.eql(url);
var name = 'Joan Maso Pau';
- expect(serviceProvider.serviceContact.individualName).to.eql(name);
+ expect(serviceProvider.ServiceContact.IndividualName).to.eql(name);
var position = 'Senior Software Engineer';
- expect(serviceProvider.serviceContact.positionName).to.eql(position);
+ expect(serviceProvider.ServiceContact.PositionName).to.eql(position);
});
it('should read ServiceIdentification tag properly', function() {
@@ -78,11 +78,11 @@ describe('ol.format.OWS 1.1', function() {
var obj = parser.readFromNode(doc.firstChild);
expect(obj).to.be.ok();
- var serviceIdentification = obj.serviceIdentification;
+ var serviceIdentification = obj.ServiceIdentification;
expect(serviceIdentification).to.be.ok();
- expect(serviceIdentification.title).to.eql('Web Map Tile Service');
- expect(serviceIdentification.serviceTypeVersion).to.eql('1.0.0');
- expect(serviceIdentification.serviceType).to.eql('OGC WMTS');
+ expect(serviceIdentification.Title).to.eql('Web Map Tile Service');
+ expect(serviceIdentification.ServiceTypeVersion).to.eql('1.0.0');
+ expect(serviceIdentification.ServiceType).to.eql('OGC WMTS');
});
it('should read OperationsMetadata tag properly', function() {
@@ -98,6 +98,7 @@ describe('ol.format.OWS 1.1', function() {
'' +
'' +
'KVP' +
+ 'SOAP' +
'' +
'' +
'' +
@@ -130,23 +131,24 @@ describe('ol.format.OWS 1.1', function() {
var obj = parser.readFromNode(doc.firstChild);
expect(obj).to.be.ok();
- var operationsMetadata = obj.operationsMetadata;
+ var operationsMetadata = obj.OperationsMetadata;
expect(operationsMetadata).to.be.ok();
- var dcp = operationsMetadata.GetCapabilities.dcp;
+ var getCap = operationsMetadata.GetCapabilities;
+ var dcp = getCap.DCP;
var url = 'http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?';
- expect(dcp.http.get[0].url).to.eql(url);
- dcp = operationsMetadata.GetCapabilities.dcp;
- expect(dcp.http.get[0].constraints.GetEncoding.allowedValues).to.eql(
- {'KVP': true});
+ expect(dcp.HTTP.Get[0].href).to.eql(url);
+ expect(dcp.HTTP.Get[0].Constraint[0].name).to.eql('GetEncoding');
+ expect(dcp.HTTP.Get[0].Constraint[0].AllowedValues.Value[0]).to.eql('KVP');
+
url = 'http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?';
- dcp = operationsMetadata.GetFeatureInfo.dcp;
- expect(dcp.http.get[0].url).to.eql(url);
- dcp = operationsMetadata.GetFeatureInfo.dcp;
- expect(dcp.http.get[0].constraints).to.be(undefined);
+ dcp = operationsMetadata.GetFeatureInfo.DCP;
+ expect(dcp.HTTP.Get[0].href).to.eql(url);
+ expect(dcp.HTTP.Get[0].Constraint).to.be(undefined);
+
url = 'http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?';
- expect(operationsMetadata.GetTile.dcp.http.get[0].url).to.eql(url);
- dcp = operationsMetadata.GetTile.dcp;
- expect(dcp.http.get[0].constraints).to.be(undefined);
+ dcp = operationsMetadata.GetTile.DCP;
+ expect(dcp.HTTP.Get[0].href).to.eql(url);
+ expect(dcp.HTTP.Get[0].Constraint).to.be(undefined);
});
});
diff --git a/test/spec/ol/format/wmts/ogcsample.xml b/test/spec/ol/format/wmts/ogcsample.xml
new file mode 100644
index 0000000000..c122fcac57
--- /dev/null
+++ b/test/spec/ol/format/wmts/ogcsample.xml
@@ -0,0 +1,184 @@
+
+
+
+ Web Map Tile Service
+ Service that contrains the map
+access interface to some TileMatrixSets
+
+ tile
+ tile matrix set
+ map
+
+ OGC WMTS
+ 1.0.0
+ none
+ none
+
+
+ MiraMon
+
+
+ Joan Maso Pau
+ Senior Software Engineer
+
+
+ +34 93 581 1312
+ +34 93 581 4151
+
+
+ Fac Ciencies UAB
+ Bellaterra
+ Barcelona
+
+ 08193
+ Spain
+ joan.maso@uab.cat
+
+
+
+
+
+
+
+
+
+
+
+
+ KVP
+ SOAP
+
+
+
+
+
+
+
+
+
+
+
+
+ KVP
+
+
+
+
+
+
+
+
+
+ Blue Marble Next Generation
+ Blue Marble Next Generation NASA Product
+
+
+ -180 -90
+ 180 90
+
+ BlueMarbleNextGeneration
+
+
+ image/jpeg
+ image/gif
+
+ BigWorldPixel
+
+
+
+
+
+ BigWorldPixel
+ urn:ogc:def:crs:OGC:1.3:CRS84
+
+ urn:ogc:def:wkss:OGC:1.0:GlobalCRS84Pixel
+
+
+ 10000m
+ 33130800.83133142
+ -180 90
+ 640
+ 480
+ 7
+ 5
+
+
+ 20000m
+ 66261601.66266284
+ -180 90
+ 640
+ 480
+ 4
+ 3
+
+
+ 40000m
+ 132523203.3253257
+ -180 90
+ 640
+ 480
+ 2
+ 2
+
+
+ 60000m
+ 198784804.9879885
+ -180 90
+ 640
+ 480
+ 1
+ 1
+
+
+ 120000m
+ 397569609.9759771
+ -180 90
+ 640
+ 480
+ 1
+ 1
+
+
+ 240000m
+ 795139219.9519541
+ -180 90
+ 640
+ 480
+ 1
+ 1
+
+
+
+ BigWorld
+ urn:ogc:def:crs:OGC:1.3:CRS84
+
+ 1e6
+ 1e6
+ -180 84
+ 256
+ 256
+ 60000
+ 50000
+
+
+ 2.5e6
+ 2.5e6
+ -180 84
+ 256
+ 256
+ 9000
+ 7000
+
+
+
+
+
diff --git a/test/spec/ol/format/wmtscapabilitiesformat.test.js b/test/spec/ol/format/wmtscapabilitiesformat.test.js
new file mode 100644
index 0000000000..9ca27ad9fc
--- /dev/null
+++ b/test/spec/ol/format/wmtscapabilitiesformat.test.js
@@ -0,0 +1,106 @@
+goog.provide('ol.test.format.WMTSCapabilities');
+
+describe('ol.format.WMTSCapabilities', function() {
+
+ describe('when parsing ogcsample.xml', function() {
+
+ var parser = new ol.format.WMTSCapabilities();
+ var capabilities;
+ before(function(done) {
+ afterLoadText('spec/ol/format/wmts/ogcsample.xml', function(xml) {
+ try {
+ capabilities = parser.read(xml);
+ } catch (e) {
+ done(e);
+ }
+ done();
+ });
+ });
+
+ it('can read Capability.Contents.Layer', function() {
+
+ expect(capabilities.Contents.Layer).to.be.an('array');
+ expect(capabilities.Contents.Layer).to.have.length(1);
+
+
+ var layer = capabilities.Contents.Layer[0];
+ expect(layer.Abstract).to.be
+ .eql('Blue Marble Next Generation NASA Product');
+ expect(layer.Identifier).to.be.eql('BlueMarbleNextGeneration');
+ expect(layer.Title).to.be.eql('Blue Marble Next Generation');
+
+ expect(layer.Format).to.be.an('array');
+ expect(layer.Format).to.have.length(2);
+ expect(layer.Format[0]).to.be.eql('image/jpeg');
+
+ expect(layer.Style).to.be.an('array');
+ expect(layer.Style).to.have.length(2);
+ expect(layer.Style[0].Identifier).to.be.eql('DarkBlue');
+ expect(layer.Style[0].isDefault).to.be(true);
+ expect(layer.Style[0].Title).to.be.eql('Dark Blue');
+ expect(layer.Style[0].LegendURL[0].href).to.be
+ .eql('http://www.miramon.uab.es/wmts/Coastlines/' +
+ 'coastlines_darkBlue.png');
+ expect(layer.Style[0].LegendURL[0].format).to.be.eql('image/png');
+
+ expect(layer.TileMatrixSetLink).to.be.an('array');
+ expect(layer.TileMatrixSetLink).to.have.length(1);
+ expect(layer.TileMatrixSetLink[0].TileMatrixSet).to.be
+ .eql('BigWorldPixel');
+
+ var wgs84Bbox = layer.WGS84BoundingBox;
+ expect(wgs84Bbox).to.be.an('array');
+ expect(wgs84Bbox[0]).to.be.eql(-180);
+ expect(wgs84Bbox[2]).to.be.eql(180);
+ expect(wgs84Bbox[1]).to.be.eql(-90);
+ expect(wgs84Bbox[3]).to.be.eql(90.0);
+
+ expect(layer.ResourceURL).to.be.an('array');
+ expect(layer.ResourceURL).to.have.length(2);
+ expect(layer.ResourceURL[0].format).to.be.eql('image/png');
+ expect(layer.ResourceURL[0].template).to.be
+ .eql('http://www.example.com/wmts/coastlines/{TileMatrix}' +
+ '/{TileRow}/{TileCol}.png');
+
+ });
+
+ it('Can read Capabilities.Content.TileMatrixSet', function() {
+ expect(capabilities.Contents.TileMatrixSet).to.be.ok();
+
+ var bigWorld = capabilities.Contents.TileMatrixSet[1];
+ expect(bigWorld).to.be.ok();
+ expect(bigWorld.Identifier).to.be.eql('BigWorld');
+ expect(bigWorld.SupportedCRS).to.be.eql('urn:ogc:def:crs:OGC:1.3:CRS84');
+ expect(bigWorld.TileMatrix).to.have.length(2);
+ expect(bigWorld.TileMatrix[0].Identifier).to.be.eql('1e6');
+ expect(bigWorld.TileMatrix[0].MatrixHeight).to.be.eql(50000);
+ expect(bigWorld.TileMatrix[0].MatrixWidth).to.be.eql(60000);
+ expect(bigWorld.TileMatrix[0].ScaleDenominator).to.be.eql(1000000);
+ expect(bigWorld.TileMatrix[0].TileWidth).to.be.eql(256);
+ expect(bigWorld.TileMatrix[0].TileHeight).to.be.eql(256);
+ expect(bigWorld.TileMatrix[0].TopLeftCorner).to.be.a('array');
+ expect(bigWorld.TileMatrix[0].TopLeftCorner[0]).to.be.eql(-180);
+ expect(bigWorld.TileMatrix[0].TopLeftCorner[1]).to.be.eql(84);
+ expect(bigWorld.TileMatrix[1].Identifier).to.be.eql('2.5e6');
+ expect(bigWorld.TileMatrix[1].MatrixHeight).to.be.eql(7000);
+ expect(bigWorld.TileMatrix[1].MatrixWidth).to.be.eql(9000);
+ expect(bigWorld.TileMatrix[1].ScaleDenominator).to.be.eql(2500000);
+ expect(bigWorld.TileMatrix[1].TileWidth).to.be.eql(256);
+ expect(bigWorld.TileMatrix[1].TileHeight).to.be.eql(256);
+ expect(bigWorld.TileMatrix[1].TopLeftCorner).to.be.a('array');
+ expect(bigWorld.TileMatrix[1].TopLeftCorner[0]).to.be.eql(-180);
+ expect(bigWorld.TileMatrix[1].TopLeftCorner[1]).to.be.eql(84);
+
+
+ });
+
+ it('Can read OWS tags', function() {
+ expect(capabilities.ServiceIdentification).to.be.ok();
+ expect(capabilities.OperationsMetadata).to.be.ok();
+
+ });
+
+ });
+});
+
+goog.require('ol.format.WMTSCapabilities');