GIS OGC之WMTS舆图服务,通过Capabilities XML描述文档,获取matrixIds,or ...

打印 上一主题 下一主题

主题 900|帖子 900|积分 2700

GIS OGC之WMTS舆图服务,通过Capabilities XML描述文档,获取matrixIds,origin,计算resolutions

需求:如何根据WMTS服务的Capabilities描述文档得到,openlayers调用wmts服务时的matrixIds,origin和resolutions参数
方法:

  • GoogleMapsCompatible (EPSG:3857)、GoogleCRS84Quad (EPSG:4326)、CGCS2000(EPSG:4490)(4490与4326差别很小,可以直接利用4326)可以直接查Web舆图切片(瓦片)服务(WMTS)简朴配置文件给出的通用比例尺分辨率(2.3.1节,2.2.2节)
  • 其他或自定义坐标系(投影),通过WMTS服务的Capabilities描述文档中ows:Identifier、TopLeftCorner、ScaleDenominator节点进行计算(2.3.3节)
1 OGC

OGC ——开放地理空间信息联盟(Open Geospatial Consortium), 是一个国际组织,致力于制定和推广开放的地理空间标准和规范。这些标准涵盖了地理信息系统(GIS)、遥感、舆图服务和其他地理空间技术。OGC的目标是提高差别系统和应用之间的数据互操纵性和共享性。而这些所谓的标准实在就是一些接口或编码的技术文档,差别的厂商、各种 GIS 产物都可以对照这些文档来定义开放服务的接口、空间数据存储的编码、空间操纵的方法。
OGC 已经是一个比较“官方”的标准化机构了,它不但包括了 ESRI、Google、Oracle 等业界强势企业作为其成员,同时还和 W3C、ISO、IEEE 等协会或组织结成合作同伴关系。因此,OGC 的标准固然并不带有强制性,但是因为其配景和汗青的缘故原由,它所制定的标准自然地具有一定的权威性。
OGC 目前提供的标准多达几十种,包括我们常用到的 WMS、WFS、WCS、WMTS 等等,另有一些地理数据信息的描述文档,比如 KML(Keyhole标志语言)、SFS(简朴对象描述)、GML(地理标志语言)、SLD(地理数据符号化)等。
服务全称WMSWeb Map Service(网络舆图服务)WFSWeb Feature Service(网络要素服务)WCSWeb Coverage Service(网络覆盖服务)WMTSWeb Map Tile Service(网络舆图切片(瓦片)服务)WMTS 是 OGC 首个支持 restful 风格的服务标准 2 WMTS

2.1 定义

WMTS(Web Map Tile Service)官网解释是"wmts定义了一组接口,用于利用具有预定义内容、范围和分辨率的分块图像对空间参考数据的舆图分块进行基于Web的哀求",简朴说来wmts是 OGC 提出的可视化标准之一,用于在网络上高效地分发和显示舆图切片(瓦片)。WMTS 通过将舆图分割成固定大小的切片(瓦片)(tiles),并允许客户端按需哀求这些切片(瓦片),从而实现了舆图数据的快速加载和高效的缓存机制。
2.2 规范分析

起首在OGC官网下载WMTS实现标准文档(OpenGIS Web Map Tile Service Implementation Standard)

2.2.1 实现操纵



  • GetCapabilities(必须实现,以是wmts都会有Capabilities文档用于说明各种参数)
    GetCapabilities操纵获取Capabilities文档,该文档描述了如何识别WMTS资源或生成WMTS哀求操纵。元数据的重要内容是TileMatrixSet摘要信息和具体内容,如界限框、支持的坐标参考系(CRS)、是否有已知的刻度集以及关于多个级别的TileMatrix数据。假如有一个可选的“主题”部分,则无需为层属性指定任何继承规则。
  • GetTile(必须实现,以是才气让客户端哀求到切片(瓦片))
    GetTile操纵获取切片(瓦片)资源,以预定义格式哀求特定tileMatrix集的特定tileMatrix。图块资源表示一个图层的舆图表达结果的一小块。
  • GetFeatureInfo(可选)
    GetFeatureInfo操纵获取要素信息(FeatureInfo)资源。该资源提供了图块舆图中某一特定像素位置处地物要素的信息,与 WMS 中 GetFeatureInfo 操纵的行为相似,以文本形式通过提供比如专题属性名称及其取值的方式返回相关信息。

2.2.2 Capabilities文档

2.2.3.1 Capabilities文档布局

Capabilities文档是xml布局形式,文档描述了服务中可用的资源以及对接该服务的必备条件,以下这几个节点信息是从本领文件中必要获取的对接WMTS服务的关键参数。

以天舆图Capabilities文档为例,重点解释contents下的节点
2.2.3.1.1 layer(图层)



  • WMTS文档定义




  • 天舆图Capabilities文档

概念解释Title图层名Identifier图层标识符WGS84BoundingBox,BoundingBox图层舆图范围(纬度,经度)Style图层的样式TileMatrixSetLink矩阵集链接,这部分只提供比例尺集合的标识符,然后必要到TileMatrixSet中去索引到对应的比例尺集合   根据差别服务还大概有Format、ResourceURL等字段
  2.2.3.1.2 TileMatrixSet(切片(瓦片)矩阵集)

WMTS规定利用切片(瓦片)矩阵集(Tile Matrix Set)来表示切割后的舆图,如下图所示。切片(瓦片)就是包罗地理数据的矩形影像,一幅舆图按一定的切片(瓦片)大小被切割成多个切片(瓦片),形成切片(瓦片)矩阵,一个或多个切片(瓦片)矩阵即组成切片(瓦片)矩阵集。差别的切片(瓦片)矩阵具有差别的分辨率,每个切片(瓦片)矩阵由切片(瓦片)矩阵标识符(一般为切片(瓦片)矩阵的序号,分辨率最低的一层为第0层,依次递增)进行标识。

   可以看到,差别级别的切片(瓦片)组合起来雷同金字塔型矩阵,切片(瓦片)数量由少逐渐变多,分辨率(resolution)由粗略到精细,比例尺(scale denominator)由高到低
  切片(瓦片)矩阵中的每个切片(瓦片)由切片(瓦片)的行列号来标识,行列号分别从切片(瓦片)矩阵左上角点所在的切片(瓦片)开始算起,起始行列值是(0,0),依次向下向右增加,如下图,也就是取切片(瓦片)的索引号。

概念解释举例左上角(TopLeftCorner)WMTS 标准中,TopLeftCorner 是描述矩阵集(TileMatrixSet)的左上角坐标的字符序列,由坐标X和坐标Y组成。航空和海运部门通常期望纬度在经度之前。固然没有标准明确规定纬度必须在经度之前,但是一般来说都会采取纬度在经度之前的顺序。比如:天舆图Capabilities文档中的矩阵会合<TopLeftCorner>90.0 -180.0</TopLeftCorner>中应该是先纬度后经度的顺序界限框的左上角坐标(TileMatrixmMinX,TileMatrixMaxY)留意界限框的原点是左下角矩阵的宽(MatrixWidth)和高(MatrixHeight)在row方向和col方向上的切片(瓦片)数切片(瓦片)的行(TileRow)和列(TileCol)行列值分别从切片(瓦片)矩阵左上角点所在的切片(瓦片)开始算起,起始行列值是(0,0),依次向下向右增加切片(瓦片)的宽(TileWidth)和高(TileHeight)一般是256*256,512*512

  • WMTS文档定义






  • 天舆图Capabilities文档

概念解释Identifier当前级别矩阵的IDTopLeftCorner当前切片(瓦片)的左上角位置,此处是经纬度直投影TileWidth、TileHeight切片(瓦片)的像素长宽,即 256 × 256 像素MatrixWidth、MatrixHeight代表这一级切片(瓦片)横向纵向跨度有多少个切片(瓦片)ScaleDenominator比例尺分母(直译,其值是一个像素代表的实际距离与像素尺寸的比值) 2.3 分辨率(resolution)获取

WMTS 服务器只提供有限种坐标系和有限种比例尺的服务,为了提高客户端和服务器的互操纵本领,WMTS 提出通用比例尺集(Well-known scale set)的概念。通用比例尺集是 WMTS 服务器之间的一个协定,由一个公共的坐标参考系统和一组公共的比例尺集合组成。
通用比例尺集有:


  • GoogleCRS84Quad
  • GoogleMapsCompatible
  • GlobalCRS84Scale
  • GlobalCRS84Pixel
  1. // 天地图经纬度投影分辨率可以直接使用
  2. const GoogleCRS84QuadResolution = [1.40625000000000, 0.703125000000000, 0.351562500000000, 0.175781250000000,
  3.     0.0878906250000000, 0.0439453125000000, 0.0219726562500000, 0.0109863281250000,
  4.     0.00549316406250000, 0.00274658203125000, 0.00137329101562500, 0.000686645507812500,
  5.     0.000343322753906250, 0.000171661376953125, 0.0000858306884765625,
  6.     0.0000429153442382812, 0.0000214576721191406, 0.0000107288360595703, 0.00000536441802978516
  7. ];
  8. // 天地图莫卡托投影分辨率可以直接使用
  9. const GoogleMapsCompatibleResolutions = [156543.0339280410, 78271.51696402048, 39135.75848201023,
  10.     19567.87924100512, 9783.939620502561, 4891.969810251280, 2445.984905125640,
  11.     1222.992452562820, 611.4962262814100, 305.7481131407048, 152.8740565703525,
  12.     76.43702828517624, 38.21851414258813, 19.10925707129406, 9.554628535647032,
  13.     4.777314267823516, 2.388657133911758, 1.194328566955879, 0.5971642834779395
  14. ];
  15. const GlobalCRS84PixelResolution= [240000, 120000, 60000, 40000,
  16.     20000, 10000, 4000, 2000,
  17.       1000, 500, 166, 100,
  18.       33, 16, 10, 3,
  19.       1, 0.33
  20. ];
  21. const GlobalCRS84ScaleResolutions = [1.25764139776733, 0.628820698883665, 0.251528279553466,
  22.     0.125764139776733, 0.0628820698883665, 0.0251528279553466, 0.0125764139776733, 0.00628820698883665,
  23.     0.00251528279553466, 0.00125764139776733, 0.000628820698883665, 0.000251528279553466,
  24.     0.000125764139776733, 0.0000628820698883665, 0.0000251528279553466, 0.0000125764139776733,
  25.     0.00000628820698883665, 0.00000251528279553466, 0.00000125764139776733, 0.000000628820698883665,
  26.     0.00000025152827955346
  27. ];
复制代码
根据Web舆图切片(瓦片)服务(WMTS)简朴配置文件,可以查到两种投影的分辨率

2.3.1 GoogleMapsCompatible(EPSG::3857)


  1. <TileMatrixSet>
  2.          <ows:Title>Google Maps Compatible for the World</ows:Title>
  3.          <ows:Identifier>WorldWebMercatorQuad</ows:Identifier>
  4.          <ows:BoundingBox crs=“urn:ogc:def:crs:EPSG::3857”>
  5.             <ows:LowerCorner>-20037508.3427892 -20037508.3427892</ows:LowerCorner>
  6.             <ows:UpperCorner>20037508.3427892 20037508.3427892</ows:UpperCorner>
  7.          </ows:BoundingBox>
  8.          <ows:SupportedCRS>
  9.              urn:ogc:def:crs:EPSG::3857
  10.          </ows:SupportedCRS>
  11.          <WellKnownScaleSet>
  12.              urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible
  13.          </WellKnownScaleSet>
  14.          <TileMatrix>
  15.             <ows:Identifier>0</ows:Identifier>
  16.             <ScaleDenominator>559082264.0287178</ScaleDenominator>
  17.             <TopLeftCorner>
  18.                 -20037508.3427892 20037508.3427892
  19.             </TopLeftCorner>
  20.             <TileWidth>256</TileWidth>
  21.             <TileHeight>256</TileHeight>
  22.             <MatrixWidth>1</MatrixWidth>
  23.             <MatrixHeight>1</MatrixHeight>
  24.          </TileMatrix>
  25.          <TileMatrix>
  26.             <ows:Identifier>1</ows:Identifier>
  27.             <ScaleDenominator>279541132.0143589</ScaleDenominator>
  28.             <TopLeftCorner>
  29.                -20037508.3427892 20037508.3427892
  30.             </TopLeftCorner>
  31.             <TileWidth>256</TileWidth>
  32.             <TileHeight>256</TileHeight>
  33.             <MatrixWidth>2</MatrixWidth>
  34.             <MatrixHeight>2</MatrixHeight>
  35.          </TileMatrix>
  36.          <TileMatrix>
  37.             <ows:Identifier>2</ows:Identifier>
  38.             <ScaleDenominator>139770566.0071794</ScaleDenominator>
  39.             <TopLeftCorner>
  40.                -20037508.3427892 20037508.3427892
  41.             </TopLeftCorner>
  42.             <TileWidth>256</TileWidth>
  43.             <TileHeight>256</TileHeight>
  44.             <MatrixWidth>4</MatrixWidth>
  45.             <MatrixHeight>4</MatrixHeight>
  46.          </TileMatrix>
  47.          <TileMatrix>
  48.             <ows:Identifier>3</ows:Identifier>
  49.             <ScaleDenominator>69885283.00358972</ScaleDenominator>
  50.             <TopLeftCorner>
  51.                -20037508.3427892 20037508.3427892
  52.             </TopLeftCorner>
  53.             <TileWidth>256</TileWidth>
  54.             <TileHeight>256</TileHeight>
  55.             <MatrixWidth>8</MatrixWidth>
  56.             <MatrixHeight>8</MatrixHeight>
  57.          </TileMatrix>
  58.          <TileMatrix>
  59.             <ows:Identifier>4</ows:Identifier>
  60.             <ScaleDenominator>34942641.50179486</ScaleDenominator>
  61.             <TopLeftCorner>
  62.                -20037508.3427892 20037508.3427892
  63.             </TopLeftCorner>
  64.             <TileWidth>256</TileWidth>
  65.             <TileHeight>256</TileHeight>
  66.             <MatrixWidth>16</MatrixWidth>
  67.             <MatrixHeight>16</MatrixHeight>
  68.          </TileMatrix>
  69.          <TileMatrix>
  70.             <ows:Identifier>5</ows:Identifier>
  71.             <ScaleDenominator>17471320.75089743</ScaleDenominator>
  72.             <TopLeftCorner>
  73.                -20037508.3427892 20037508.3427892
  74.             </TopLeftCorner>
  75.             <TileWidth>256</TileWidth>
  76.             <TileHeight>256</TileHeight>
  77.             <MatrixWidth>32</MatrixWidth>
  78.             <MatrixHeight>32</MatrixHeight>
  79.          </TileMatrix>
  80.          <TileMatrix>
  81.             <ows:Identifier>6</ows:Identifier>
  82.             <ScaleDenominator>8735660.375448715</ScaleDenominator>
  83.             <TopLeftCorner>
  84.                -20037508.3427892 20037508.3427892
  85.             </TopLeftCorner>
  86.             <TileWidth>256</TileWidth>
  87.             <TileHeight>256</TileHeight>
  88.             <MatrixWidth>64</MatrixWidth>
  89.             <MatrixHeight>64</MatrixHeight>
  90.          </TileMatrix>
  91.          <TileMatrix>
  92.             <ows:Identifier>7</ows:Identifier>
  93.             <ScaleDenominator>4367830.187724357</ScaleDenominator>
  94.             <TopLeftCorner>
  95.                -20037508.3427892 20037508.3427892
  96.             </TopLeftCorner>
  97.             <TileWidth>256</TileWidth>
  98.             <TileHeight>256</TileHeight>
  99.             <MatrixWidth>128</MatrixWidth>
  100.             <MatrixHeight>128</MatrixHeight>
  101.          </TileMatrix>
  102.          <TileMatrix>
  103.             <ows:Identifier>8</ows:Identifier>
  104.             <ScaleDenominator>2183915.093862179</ScaleDenominator>
  105.             <TopLeftCorner>
  106.                -20037508.3427892 20037508.3427892
  107.             </TopLeftCorner>
  108.             <TileWidth>256</TileWidth>
  109.             <TileHeight>256</TileHeight>
  110.             <MatrixWidth>256</MatrixWidth>
  111.             <MatrixHeight>256</MatrixHeight>
  112.          </TileMatrix>
  113.          <TileMatrix>
  114.             <ows:Identifier>9</ows:Identifier>
  115.             <ScaleDenominator>1091957.546931089</ScaleDenominator>
  116.             <TopLeftCorner>
  117.                -20037508.3427892 20037508.3427892
  118.             </TopLeftCorner>
  119.             <TileWidth>256</TileWidth>
  120.             <TileHeight>256</TileHeight>
  121.             <MatrixWidth>512</MatrixWidth>
  122.             <MatrixHeight>512</MatrixHeight>
  123.          </TileMatrix>
  124.          <TileMatrix>
  125.             <ows:Identifier>10</ows:Identifier>
  126.             <ScaleDenominator>545978.7734655447</ScaleDenominator>
  127.             <TopLeftCorner>
  128.                -20037508.3427892 20037508.3427892
  129.             </TopLeftCorner>
  130.             <TileWidth>256</TileWidth>
  131.             <TileHeight>256</TileHeight>
  132.             <MatrixWidth>1024</MatrixWidth>
  133.             <MatrixHeight>1024</MatrixHeight>
  134.          </TileMatrix>
  135.          <TileMatrix>
  136.             <ows:Identifier>11</ows:Identifier>
  137.             <ScaleDenominator>272989.3867327723</ScaleDenominator>
  138.             <TopLeftCorner>
  139.                -20037508.3427892 20037508.3427892
  140.             </TopLeftCorner>
  141.             <TileWidth>256</TileWidth>
  142.             <TileHeight>256</TileHeight>
  143.             <MatrixWidth>2048</MatrixWidth>
  144.             <MatrixHeight>2048</MatrixHeight>
  145.          </TileMatrix>
  146.          <TileMatrix>
  147.             <ows:Identifier>12</ows:Identifier>
  148.             <ScaleDenominator>136494.6933663862</ScaleDenominator>
  149.             <TopLeftCorner>
  150.                -20037508.3427892 20037508.3427892
  151.             </TopLeftCorner>
  152.             <TileWidth>256</TileWidth>
  153.             <TileHeight>256</TileHeight>
  154.             <MatrixWidth>4096</MatrixWidth>
  155.             <MatrixHeight>4096</MatrixHeight>
  156.          </TileMatrix>
  157.          <TileMatrix>
  158.             <ows:Identifier>13</ows:Identifier>
  159.             <ScaleDenominator>68247.34668319309</ScaleDenominator>
  160.             <TopLeftCorner>
  161.                -20037508.3427892 20037508.3427892
  162.             </TopLeftCorner>
  163.             <TileWidth>256</TileWidth>
  164.             <TileHeight>256</TileHeight>
  165.             <MatrixWidth>8192</MatrixWidth>
  166.             <MatrixHeight>8192</MatrixHeight>
  167.          </TileMatrix>
  168.          <TileMatrix>
  169.             <ows:Identifier>14</ows:Identifier>
  170.             <ScaleDenominator>34123.67334159654</ScaleDenominator>
  171.             <TopLeftCorner>
  172.                -20037508.3427892 20037508.3427892
  173.             </TopLeftCorner>
  174.             <TileWidth>256</TileWidth>
  175.             <TileHeight>256</TileHeight>
  176.             <MatrixWidth>16384</MatrixWidth>
  177.             <MatrixHeight>16384</MatrixHeight>
  178.          </TileMatrix>
  179.          <TileMatrix>
  180.             <ows:Identifier>15</ows:Identifier>
  181.             <ScaleDenominator>17061.83667079827</ScaleDenominator>
  182.             <TopLeftCorner>
  183.                -20037508.3427892 20037508.3427892
  184.             </TopLeftCorner>
  185.             <TileWidth>256</TileWidth>
  186.             <TileHeight>256</TileHeight>
  187.             <MatrixWidth>32768</MatrixWidth>
  188.             <MatrixHeight>32768</MatrixHeight>
  189.          </TileMatrix>
  190.          <TileMatrix>
  191.             <ows:Identifier>16</ows:Identifier>
  192.             <ScaleDenominator>8530.918335399136</ScaleDenominator>
  193.             <TopLeftCorner>
  194.                -20037508.3427892 20037508.3427892
  195.             </TopLeftCorner>
  196.             <TileWidth>256</TileWidth>
  197.             <TileHeight>256</TileHeight>
  198.             <MatrixWidth>65536</MatrixWidth>
  199.             <MatrixHeight>65536</MatrixHeight>
  200.          </TileMatrix>
  201.          <TileMatrix>
  202.             <ows:Identifier>17</ows:Identifier>
  203.             <ScaleDenominator>4265.459167699568</ScaleDenominator>
  204.             <TopLeftCorner>
  205.                -20037508.3427892 20037508.3427892
  206.             </TopLeftCorner>
  207.             <TileWidth>256</TileWidth>
  208.             <TileHeight>256</TileHeight>
  209.             <MatrixWidth>131072</MatrixWidth>
  210.             <MatrixHeight>131072</MatrixHeight>
  211.          </TileMatrix>
  212.          <TileMatrix>
  213.             <ows:Identifier>18</ows:Identifier>
  214.             <ScaleDenominator>2132.729583849784</ScaleDenominator>
  215.             <TopLeftCorner>
  216.                -20037508.3427892 20037508.3427892
  217.             </TopLeftCorner>
  218.             <TileWidth>256</TileWidth>
  219.             <TileHeight>256</TileHeight>
  220.             <MatrixWidth>262114</MatrixWidth>
  221.             <MatrixHeight>262114</MatrixHeight>
  222.          </TileMatrix>
  223.       </TileMatrixSet>
复制代码
参数如下:
CRS: urngc:def:crs:EPSG:6.18:3:3857
WGS 84 / Pseudo-Mercator
BBOX LowerCorner: -20037508.3427892 -20037508.3427892
BBOX UpperCorner: 20037508.3427892 20037508.3427892
WellKnownScaleSet:
urngc:def:wkss:OGC:1.0:GoogleMapsCompatible
TopLeftCorner: -20037508.3427892 20037508.3427892
TileWidth: 256
TileHeight: 256
Zoom level idScale DenominatorPixel Size (m)Matrix WidthMatrix Height0559082264.0287178156543.0339280410111279541132.014358978271.51696402048222139770566.007179439135.7584820102344369885283.0035897219567.8792410051288434942641.501794869783.9396205025611616517471320.750897434891.969810251280323268735660.3754487152445.984905125640646474367830.1877243571222.99245256282012812882183915.093862179611.496226281410025625691091957.546931089305.748113140704851251210545978.7734655447152.87405657035251024102411272989.386732772376.437028285176242048204812136494.693366386238.21851414258813409640961368247.3466831930919.10925707129406819281921434123.673341596549.55462853564703216384163841517061.836670798274.7773142678235163276832768168530.9183353991362.3886571339117586553665536174265.4591676995681.194328566955879131072131072182132.7295838497840.5971642834779395262144262144 此中:


  • Pixel Size单元是米(m)
  • TopLeftCorner即为ol中的origin数组
  • 各级Zoom level id集合起来即为ol中的matrixIds数组
  • 各级Pixel Size (m)集合起来即为ol中的resolutions数组
  • 天舆图莫卡托投影固然各级Scale Denominator和上面GoogleMapsCompatible(EPSG的各级Scale Denominator不一样,但是计算出来的分辨率是一样的,也就是上面Pixel Size (degrees)数组(因为都是EPSG:3857)
2.3.2 GoogleCRS84Quad (可以明确为EPSG:4326)

  1. <TileMatrixSet>
  2.          <ows:Title>CRS84 for the World</ows:Title>
  3.          <ows:Identifier>WorldCRS84Quad</ows:Identifier>
  4.          <ows:BoundingBox crs=“urn:ogc:def:crs:OGC:1.3:CRS84”>
  5.             <ows:LowerCorner>-180 -90</ows:LowerCorner>
  6.             <ows:UpperCorner>180 90</ows:UpperCorner>
  7.          </ows:BoundingBox>
  8.          <ows:SupportedCRS>
  9.             urn:ogc:def:crs:OGC:1.3:CRS84
  10.          </ows:SupportedCRS>
  11.          <WellKnownScaleSet>
  12.             urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad
  13.          </WellKnownScaleSet>
  14.          <TileMatrix>
  15.             <ows:Identifier>-1</ows:Identifier>
  16.             <ScaleDenominator>559082264.0287178</ScaleDenominator>
  17.             <TopLeftCorner>-180 90</TopLeftCorner>
  18.             <TileWidth>256</TileWidth>
  19.             <TileHeight>256</TileHeight>
  20.             <MatrixWidth>1</MatrixWidth>
  21.             <MatrixHeight>1</MatrixHeight>
  22.          </TileMatrix>
  23.          <TileMatrix>
  24.             <ows:Identifier>0</ows:Identifier>
  25.             <ScaleDenominator>279541132.0143589</ScaleDenominator>
  26.             <TopLeftCorner>-180 90</TopLeftCorner>
  27.             <TileWidth>256</TileWidth>
  28.             <TileHeight>256</TileHeight>
  29.             <MatrixWidth>2</MatrixWidth>
  30.             <MatrixHeight>1</MatrixHeight>
  31.          </TileMatrix>
  32.          <TileMatrix>
  33.             <ows:Identifier>1</ows:Identifier>
  34.             <ScaleDenominator>139770566.0071794</ScaleDenominator>
  35.             <TopLeftCorner>-180 90</TopLeftCorner>
  36.             <TileWidth>256</TileWidth>
  37.             <TileHeight>256</TileHeight>
  38.             <MatrixWidth>4</MatrixWidth>
  39.             <MatrixHeight>2</MatrixHeight>
  40.          </TileMatrix>
  41.          <TileMatrix>
  42.             <ows:Identifier>2</ows:Identifier>
  43.             <ScaleDenominator>69885283.00358972</ScaleDenominator>
  44.             <TopLeftCorner>-180 90</TopLeftCorner>
  45.             <TileWidth>256</TileWidth>
  46.             <TileHeight>256</TileHeight>
  47.             <MatrixWidth>8</MatrixWidth>
  48.             <MatrixHeight>4</MatrixHeight>
  49.          </TileMatrix>
  50.          <TileMatrix>
  51.             <ows:Identifier>3</ows:Identifier>
  52.             <ScaleDenominator>34942641.50179486</ScaleDenominator>
  53.             <TopLeftCorner>-180 90</TopLeftCorner>
  54.             <TileWidth>256</TileWidth>
  55.             <TileHeight>256</TileHeight>
  56.             <MatrixWidth>16</MatrixWidth>
  57.             <MatrixHeight>8</MatrixHeight>
  58.          </TileMatrix>
  59.          <TileMatrix>
  60.             <ows:Identifier>4</ows:Identifier>
  61.             <ScaleDenominator>17471320.75089743</ScaleDenominator>
  62.             <TopLeftCorner>-180 90</TopLeftCorner>
  63.             <TileWidth>256</TileWidth>
  64.             <TileHeight>256</TileHeight>
  65.             <MatrixWidth>32</MatrixWidth>
  66.             <MatrixHeight>16</MatrixHeight>
  67.          </TileMatrix>
  68.          <TileMatrix>
  69.             <ows:Identifier>5</ows:Identifier>
  70.             <ScaleDenominator>8735660.375448715</ScaleDenominator>
  71.             <TopLeftCorner>-180 90</TopLeftCorner>
  72.             <TileWidth>256</TileWidth>
  73.             <TileHeight>256</TileHeight>
  74.             <MatrixWidth>64</MatrixWidth>
  75.             <MatrixHeight>32</MatrixHeight>
  76.          </TileMatrix>
  77.          <TileMatrix>
  78.             <ows:Identifier>6</ows:Identifier>
  79.             <ScaleDenominator>4367830.187724357</ScaleDenominator>
  80.             <TopLeftCorner>-180 90</TopLeftCorner>
  81.             <TileWidth>256</TileWidth>
  82.             <TileHeight>256</TileHeight>
  83.             <MatrixWidth>128</MatrixWidth>
  84.             <MatrixHeight>64</MatrixHeight>
  85.          </TileMatrix>
  86.          <TileMatrix>
  87.             <ows:Identifier>7</ows:Identifier>
  88.             <ScaleDenominator>2183915.093862179</ScaleDenominator>
  89.             <TopLeftCorner>-180 90</TopLeftCorner>
  90.             <TileWidth>256</TileWidth>
  91.             <TileHeight>256</TileHeight>
  92.             <MatrixWidth>256</MatrixWidth>
  93.             <MatrixHeight>128</MatrixHeight>
  94.          </TileMatrix>
  95.          <TileMatrix>
  96.             <ows:Identifier>8</ows:Identifier>
  97.             <ScaleDenominator>1091957.546931089</ScaleDenominator>
  98.             <TopLeftCorner>-180 90</TopLeftCorner>
  99.             <TileWidth>256</TileWidth>
  100.             <TileHeight>256</TileHeight>
  101.             <MatrixWidth>512</MatrixWidth>
  102.             <MatrixHeight>256</MatrixHeight>
  103.          </TileMatrix>
  104.          <TileMatrix>
  105.             <ows:Identifier>9</ows:Identifier>
  106.             <ScaleDenominator>545978.7734655447</ScaleDenominator>
  107.             <TopLeftCorner>-180 90</TopLeftCorner>
  108.             <TileWidth>256</TileWidth>
  109.             <TileHeight>256</TileHeight>
  110.             <MatrixWidth>1024</MatrixWidth>
  111.             <MatrixHeight>512</MatrixHeight>
  112.          </TileMatrix>
  113.          <TileMatrix>
  114.             <ows:Identifier>10</ows:Identifier>
  115.             <ScaleDenominator>272989.3867327723</ScaleDenominator>
  116.             <TopLeftCorner>-180 90</TopLeftCorner>
  117.             <TileWidth>256</TileWidth>
  118.             <TileHeight>256</TileHeight>
  119.             <MatrixWidth>2048</MatrixWidth>
  120.             <MatrixHeight>1024</MatrixHeight>
  121.          </TileMatrix>
  122.          <TileMatrix>
  123.             <ows:Identifier>11</ows:Identifier>
  124.             <ScaleDenominator>136494.6933663862</ScaleDenominator>
  125.             <TopLeftCorner>-180 90</TopLeftCorner>
  126.             <TileWidth>256</TileWidth>
  127.             <TileHeight>256</TileHeight>
  128.             <MatrixWidth>4096</MatrixWidth>
  129.             <MatrixHeight>2048</MatrixHeight>
  130.          </TileMatrix>
  131.          <TileMatrix>
  132.             <ows:Identifier>12</ows:Identifier>
  133.             <ScaleDenominator>68247.34668319309</ScaleDenominator>
  134.             <TopLeftCorner>-180 90</TopLeftCorner>
  135.             <TileWidth>256</TileWidth>
  136.             <TileHeight>256</TileHeight>
  137.             <MatrixWidth>8192</MatrixWidth>
  138.             <MatrixHeight>4096</MatrixHeight>
  139.          </TileMatrix>
  140.          <TileMatrix>
  141.             <ows:Identifier>13</ows:Identifier>
  142.             <ScaleDenominator>34123.67334159654</ScaleDenominator>
  143.             <TopLeftCorner>-180 90</TopLeftCorner>
  144.             <TileWidth>256</TileWidth>
  145.             <TileHeight>256</TileHeight>
  146.             <MatrixWidth>16384</MatrixWidth>
  147.             <MatrixHeight>8192</MatrixHeight>
  148.          </TileMatrix>
  149.          <TileMatrix>
  150.             <ows:Identifier>14</ows:Identifier>
  151.             <ScaleDenominator>17061.83667079827</ScaleDenominator>
  152.             <TopLeftCorner>-180 90</TopLeftCorner>
  153.             <TileWidth>256</TileWidth>
  154.             <TileHeight>256</TileHeight>
  155.             <MatrixWidth>32768</MatrixWidth>
  156.             <MatrixHeight>16384</MatrixHeight>
  157.          </TileMatrix>
  158.          <TileMatrix>
  159.             <ows:Identifier>15</ows:Identifier>
  160.             <ScaleDenominator>8530.918335399136</ScaleDenominator>
  161.             <TopLeftCorner>-180 90</TopLeftCorner>
  162.             <TileWidth>256</TileWidth>
  163.             <TileHeight>256</TileHeight>
  164.             <MatrixWidth>65536</MatrixWidth>
  165.             <MatrixHeight>32768</MatrixHeight>
  166.          </TileMatrix>
  167.          <TileMatrix>
  168.             <ows:Identifier>16</ows:Identifier>
  169.             <ScaleDenominator>4265.459167699568</ScaleDenominator>
  170.             <TopLeftCorner>-180 90</TopLeftCorner>
  171.             <TileWidth>256</TileWidth>
  172.             <TileHeight>256</TileHeight>
  173.             <MatrixWidth>131072</MatrixWidth>
  174.             <MatrixHeight>65536</MatrixHeight>
  175.          </TileMatrix>
  176.          <TileMatrix>
  177.             <ows:Identifier>17</ows:Identifier>
  178.             <ScaleDenominator>2132.729583849784</ScaleDenominator>
  179.             <TopLeftCorner>-180 90</TopLeftCorner>
  180.             <TileWidth>256</TileWidth>
  181.             <TileHeight>256</TileHeight>
  182.             <MatrixWidth>262144</MatrixWidth>
  183.             <MatrixHeight>131072</MatrixHeight>
  184.          </TileMatrix>
  185.       </TileMatrixSet>
复制代码
参数如下:
CRS: urngc:def:crs:OGC:1.3:CRS84 CRS84
BBOX LowerCorner: -180 -90
BBOX UpperCorner: 180 90
WellKnownScaleSet: urngc:def:wkss:OGC:1.0:GoogleCRS84Quad
TopLeftCorner: -180 90
TileWidth: 256
TileHeight: 256
Zoom level idScale DenominatorPixel Size (degrees)Matrix WidthMatrix Height-1559082264.02871781.40625000000000110279541132.01435890.703125000000000211139770566.00717940.35156250000000042269885283.003589720.17578125000000084334942641.501794868.78906250000000 *10-2168417471320.750897434.39453125000000 *10-2321658735660.3754487152.19726562500000 *10-2643264367830.1877243571.09863281250000 *10-21286472183915.0938621795.49316406250000 *10-325612881091957.5469310892.74658203125000 *10-35122569545978.77346554471.37329101562500 *10-3102451210272989.38673277236.86645507812500 *10-42048102411136494.69336638623.43322753906250 *10-4409620481268247.346683193091.71661376953125 *10-4819240961334123.673341596548.58306884765625 *10-51638481921417061.836670798274.29153442382812 *10-53276816384158530.9183353991362.14576721191406 *10-56553632768164265.4591676995681.07288360595703 *10-513107265536172132.7295838497845.36441802978516 *10-6262144131072 此中:


  • Pixel Size单元是度(degrees)
  • TopLeftCorner即为ol中的origin数组
  • 各级Zoom level id集合起来即为ol中的matrixIds数组
  • 各级Pixel Size (degrees)集合起来即为ol中的resolutions数组
  • 天舆图经纬度投影固然各级Scale Denominator和上面GoogleCRS84Quad的各级Scale Denominator不一样,但是计算出来的分辨率是一样的(因为都是EPSG:4326),也就是上面Pixel Size (degrees)数组
2.3.3 自定义坐标系(投影)


2.3.3.1 检察Capabilities描述文档

根据前面的规范分析,WMTS服务必须实现GetCapabilities操纵,也就是一定有一个描述文档,一般访问路径是如许的格式http://example.com/wmts?request=GetCapabilities,检察中的TileMatrixSet节点下参数,如下图:



  • TopLeftCorner即为ol中的origin数组(留意,假如是经纬度投影,顺序是纬度经度,origin顺序是经度纬度)
  • 各级ows:Identifier集合起来即为ol中的matrixIds数组(根据文档,ows:Identifier为-1的可以删除)
  • ScaleDenominator集合起来经过计算后才气得到ol中的resolutions数组
**分辨率(resolution)的计算**:
  由此,可以计算出每一级的分辨率,比如天舆图经纬度投影,
  1. <Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
  2. <script/>
  3. <ows:ServiceIdentification>
  4. <ows:Title>在线地图服务</ows:Title>
  5. <ows:Abstract>基于OGC标准的地图服务</ows:Abstract>
  6. <ows:Keywords>
  7. <ows:Keyword>OGC</ows:Keyword>
  8. </ows:Keywords>
  9. <ows:ServiceType codeSpace="wmts"/>
  10. <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
  11. <ows:Fees>none</ows:Fees>
  12. <ows:AccessConstraints>none</ows:AccessConstraints>
  13. </ows:ServiceIdentification>
  14. <ows:ServiceProvider>
  15. <ows:ProviderName>国家基础地理信息中心</ows:ProviderName>
  16. <ows:ProviderSite>http://www.tianditu.gov.cn</ows:ProviderSite>
  17. <ows:ServiceContact>
  18. <ows:IndividualName>Mr Wang</ows:IndividualName>
  19. <ows:PositionName>Software Engineer</ows:PositionName>
  20. <ows:ContactInfo>
  21. <ows:Phone>
  22. <ows:Voice>010-63881203</ows:Voice>
  23. <ows:Facsimile>010-63881203</ows:Facsimile>
  24. </ows:Phone>
  25. <ows:Address>
  26. <ows:DeliveryPoint>北京市海淀区莲花池西路28号</ows:DeliveryPoint>
  27. <ows:City>北京市</ows:City>
  28. <ows:AdministrativeArea>北京市</ows:AdministrativeArea>
  29. <ows:Country>中国</ows:Country>
  30. <ows:PostalCode>100830</ows:PostalCode>
  31. <ows:ElectronicMailAddress>tdt@ngcc.cn</ows:ElectronicMailAddress>
  32. </ows:Address>
  33. <ows:OnlineResource xlink:type="simple" xlink:href="http://www.tianditu.gov.cn"/>
  34. </ows:ContactInfo>
  35. </ows:ServiceContact>
  36. </ows:ServiceProvider>
  37. <ows:OperationsMetadata>
  38. <ows:Operation name="GetCapabilities">
  39. <ows:DCP>
  40. <ows:HTTP>
  41. <ows:Get xlink:href="http://t0.tianditu.gov.cn/img_c/wmts?">
  42. <ows:Constraint name="GetEncoding">
  43. <ows:AllowedValues>
  44. <ows:Value>KVP</ows:Value>
  45. </ows:AllowedValues>
  46. </ows:Constraint>
  47. </ows:Get>
  48. </ows:HTTP>
  49. </ows:DCP>
  50. </ows:Operation>
  51. <ows:Operation name="GetTile">
  52. <ows:DCP>
  53. <ows:HTTP>
  54. <ows:Get xlink:href="http://t0.tianditu.gov.cn/img_c/wmts?">
  55. <ows:Constraint name="GetEncoding">
  56. <ows:AllowedValues>
  57. <ows:Value>KVP</ows:Value>
  58. </ows:AllowedValues>
  59. </ows:Constraint>
  60. </ows:Get>
  61. </ows:HTTP>
  62. </ows:DCP>
  63. </ows:Operation>
  64. </ows:OperationsMetadata>
  65. <Contents>
  66. <Layer>
  67. <ows:Title>img</ows:Title>
  68. <ows:Abstract>img</ows:Abstract>
  69. <ows:Identifier>img</ows:Identifier>
  70. <ows:WGS84BoundingBox>
  71. <ows:LowerCorner>-180.0 -90.0</ows:LowerCorner>
  72. <ows:UpperCorner>180.0 90.0</ows:UpperCorner>
  73. </ows:WGS84BoundingBox>
  74. <ows:BoundingBox>
  75. <ows:LowerCorner>-180.0 -90.0</ows:LowerCorner>
  76. <ows:UpperCorner>180.0 90.0</ows:UpperCorner>
  77. </ows:BoundingBox>
  78. <Style>
  79. <ows:Identifier>default</ows:Identifier>
  80. </Style>
  81. <Format>tiles</Format>
  82. <TileMatrixSetLink>
  83. <TileMatrixSet>c</TileMatrixSet>
  84. </TileMatrixSetLink>
  85. </Layer>
  86. <TileMatrixSet>
  87. <ows:Identifier>c</ows:Identifier>
  88. <ows:SupportedCRS>urn:ogc:def:crs:EPSG::4490</ows:SupportedCRS>
  89. <TileMatrix>
  90. <ows:Identifier>1</ows:Identifier>
  91. <ScaleDenominator>2.958293554545656E8</ScaleDenominator>
  92. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  93. <TileWidth>256</TileWidth>
  94. <TileHeight>256</TileHeight>
  95. <MatrixWidth>2</MatrixWidth>
  96. <MatrixHeight>1</MatrixHeight>
  97. </TileMatrix>
  98. <TileMatrix>
  99. <ows:Identifier>2</ows:Identifier>
  100. <ScaleDenominator>1.479146777272828E8</ScaleDenominator>
  101. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  102. <TileWidth>256</TileWidth>
  103. <TileHeight>256</TileHeight>
  104. <MatrixWidth>4</MatrixWidth>
  105. <MatrixHeight>2</MatrixHeight>
  106. </TileMatrix>
  107. <TileMatrix>
  108. <ows:Identifier>3</ows:Identifier>
  109. <ScaleDenominator>7.39573388636414E7</ScaleDenominator>
  110. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  111. <TileWidth>256</TileWidth>
  112. <TileHeight>256</TileHeight>
  113. <MatrixWidth>8</MatrixWidth>
  114. <MatrixHeight>4</MatrixHeight>
  115. </TileMatrix>
  116. <TileMatrix>
  117. <ows:Identifier>4</ows:Identifier>
  118. <ScaleDenominator>3.69786694318207E7</ScaleDenominator>
  119. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  120. <TileWidth>256</TileWidth>
  121. <TileHeight>256</TileHeight>
  122. <MatrixWidth>16</MatrixWidth>
  123. <MatrixHeight>8</MatrixHeight>
  124. </TileMatrix>
  125. <TileMatrix>
  126. <ows:Identifier>5</ows:Identifier>
  127. <ScaleDenominator>1.848933471591035E7</ScaleDenominator>
  128. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  129. <TileWidth>256</TileWidth>
  130. <TileHeight>256</TileHeight>
  131. <MatrixWidth>32</MatrixWidth>
  132. <MatrixHeight>16</MatrixHeight>
  133. </TileMatrix>
  134. <TileMatrix>
  135. <ows:Identifier>6</ows:Identifier>
  136. <ScaleDenominator>9244667.357955175</ScaleDenominator>
  137. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  138. <TileWidth>256</TileWidth>
  139. <TileHeight>256</TileHeight>
  140. <MatrixWidth>64</MatrixWidth>
  141. <MatrixHeight>32</MatrixHeight>
  142. </TileMatrix>
  143. <TileMatrix>
  144. <ows:Identifier>7</ows:Identifier>
  145. <ScaleDenominator>4622333.678977588</ScaleDenominator>
  146. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  147. <TileWidth>256</TileWidth>
  148. <TileHeight>256</TileHeight>
  149. <MatrixWidth>128</MatrixWidth>
  150. <MatrixHeight>64</MatrixHeight>
  151. </TileMatrix>
  152. <TileMatrix>
  153. <ows:Identifier>8</ows:Identifier>
  154. <ScaleDenominator>2311166.839488794</ScaleDenominator>
  155. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  156. <TileWidth>256</TileWidth>
  157. <TileHeight>256</TileHeight>
  158. <MatrixWidth>256</MatrixWidth>
  159. <MatrixHeight>128</MatrixHeight>
  160. </TileMatrix>
  161. <TileMatrix>
  162. <ows:Identifier>9</ows:Identifier>
  163. <ScaleDenominator>1155583.419744397</ScaleDenominator>
  164. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  165. <TileWidth>256</TileWidth>
  166. <TileHeight>256</TileHeight>
  167. <MatrixWidth>512</MatrixWidth>
  168. <MatrixHeight>256</MatrixHeight>
  169. </TileMatrix>
  170. <TileMatrix>
  171. <ows:Identifier>10</ows:Identifier>
  172. <ScaleDenominator>577791.7098721985</ScaleDenominator>
  173. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  174. <TileWidth>256</TileWidth>
  175. <TileHeight>256</TileHeight>
  176. <MatrixWidth>1024</MatrixWidth>
  177. <MatrixHeight>512</MatrixHeight>
  178. </TileMatrix>
  179. <TileMatrix>
  180. <ows:Identifier>11</ows:Identifier>
  181. <ScaleDenominator>288895.85493609926</ScaleDenominator>
  182. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  183. <TileWidth>256</TileWidth>
  184. <TileHeight>256</TileHeight>
  185. <MatrixWidth>2048</MatrixWidth>
  186. <MatrixHeight>1024</MatrixHeight>
  187. </TileMatrix>
  188. <TileMatrix>
  189. <ows:Identifier>12</ows:Identifier>
  190. <ScaleDenominator>144447.92746804963</ScaleDenominator>
  191. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  192. <TileWidth>256</TileWidth>
  193. <TileHeight>256</TileHeight>
  194. <MatrixWidth>4096</MatrixWidth>
  195. <MatrixHeight>2048</MatrixHeight>
  196. </TileMatrix>
  197. <TileMatrix>
  198. <ows:Identifier>13</ows:Identifier>
  199. <ScaleDenominator>72223.96373402482</ScaleDenominator>
  200. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  201. <TileWidth>256</TileWidth>
  202. <TileHeight>256</TileHeight>
  203. <MatrixWidth>8192</MatrixWidth>
  204. <MatrixHeight>4096</MatrixHeight>
  205. </TileMatrix>
  206. <TileMatrix>
  207. <ows:Identifier>14</ows:Identifier>
  208. <ScaleDenominator>36111.98186701241</ScaleDenominator>
  209. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  210. <TileWidth>256</TileWidth>
  211. <TileHeight>256</TileHeight>
  212. <MatrixWidth>16384</MatrixWidth>
  213. <MatrixHeight>8192</MatrixHeight>
  214. </TileMatrix>
  215. <TileMatrix>
  216. <ows:Identifier>15</ows:Identifier>
  217. <ScaleDenominator>18055.990933506204</ScaleDenominator>
  218. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  219. <TileWidth>256</TileWidth>
  220. <TileHeight>256</TileHeight>
  221. <MatrixWidth>32768</MatrixWidth>
  222. <MatrixHeight>16384</MatrixHeight>
  223. </TileMatrix>
  224. <TileMatrix>
  225. <ows:Identifier>16</ows:Identifier>
  226. <ScaleDenominator>9027.995466753102</ScaleDenominator>
  227. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  228. <TileWidth>256</TileWidth>
  229. <TileHeight>256</TileHeight>
  230. <MatrixWidth>65536</MatrixWidth>
  231. <MatrixHeight>32768</MatrixHeight>
  232. </TileMatrix>
  233. <TileMatrix>
  234. <ows:Identifier>17</ows:Identifier>
  235. <ScaleDenominator>4513.997733376551</ScaleDenominator>
  236. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  237. <TileWidth>256</TileWidth>
  238. <TileHeight>256</TileHeight>
  239. <MatrixWidth>131072</MatrixWidth>
  240. <MatrixHeight>65536</MatrixHeight>
  241. </TileMatrix>
  242. <TileMatrix>
  243. <ows:Identifier>18</ows:Identifier>
  244. <ScaleDenominator>2256.998866688275</ScaleDenominator>
  245. <TopLeftCorner>90.0 -180.0</TopLeftCorner>
  246. <TileWidth>256</TileWidth>
  247. <TileHeight>256</TileHeight>
  248. <MatrixWidth>262144</MatrixWidth>
  249. <MatrixHeight>131072</MatrixHeight>
  250. </TileMatrix>
  251. </TileMatrixSet>
  252. </Contents>
  253. </Capabilities>
复制代码
可以得到ol的wmts参数:
  1. const origin= [90,-180]
  2. const matrixIds= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
  3. const resolutions=[
  4.               2.958293554545656e8, 1.479146777272828e8, 7.39573388636414e7, 3.69786694318207e7,
  5.               1.848933471591035e7, 9244667.357955175, 4622333.678977588, 2311166.839488794,
  6.               1155583.419744397, 577791.7098721985, 288895.85493609926, 144447.92746804963,
  7.               72223.96373402482, 36111.98186701241, 18055.990933506204, 9027.995466753102,
  8.               4513.997733376551, 2256.998866688275
  9.             ].map(item=> 0.0254 * item / (96 * (Math.PI * 2 * 6378137 / 360)))  
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

杀鸡焉用牛刀

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表