首页 / 浏览问题 / 云GIS / 问题详情
wmts接口配置
1EXP 2017年09月25日
我这里有tif文件,要切成瓦片缓存,三个比例尺1128.497176,564.248588,282.124294,对应的级别为19,20,21,但是现在发出的wmts服务对应的,0:1128.497176,1:564.248588,2:282.124294。在js端请求瓦片时,对应的层是19,20,21,我需要将0转成19,1转成20,2转成21,现在想通过wmts接口配置实现这个功能。新建了一个wmts101接口,想请帮配置一下,目前代码如下:

    <interface class="com.supermap.services.wmts.WMTSServlet" name="wmts101">
      <config class="com.supermap.services.wmts.WMTSConfig">
        <identification>
          <keywords/>
        </identification>  
        <provider>
          <serviceContact/>
        </provider>  
        <tileMatrixSets>
          <com.supermap.services.wmts.TileMatrixSet>
            <wellKnownScaleSet>Custom</wellKnownScaleSet>  
            <scales>1128.497176,564.248588,282.124294</scales>  
            <dpi>90.7142857142857</dpi>  
            <tileWidth>256</tileWidth>  
            <tileHeight>256</tileHeight>
          </com.supermap.services.wmts.TileMatrixSet>           
        </tileMatrixSets>  
        <customEntireBounds>-2.0037508342789244E7,-2.0037508342789244E7,2.0037508342789244E7,2.0037508342789244E7</customEntireBounds>
        <verifyMode>DEFAULT</verifyMode>
      </config>
    </interface>

1个回答

就不问具体为什么这么做了,iServer发布WMTS瓦片矩阵集的瓦片矩阵标识是从0开始的,要么在前面加比例尺(直接在iDesktop生成地图缓存那儿导出缓存配置文件.sci,替换UGC5.0的sci,或者手动向sci文件中相关地方添加比例尺,其它类型缓存用对应数据库工具改metadata表即可),要么叠加的时候判断缩放级别再切换地图。
改WMTS接口配置也可以,iServer类参考: TileMatrixSet TileMatrix

即再设置 TileMatrixSetmatrixList属性(也可能是tileMatrixs属性建议使用类的全名),比如:

<com.supermap.services.wmts.TileMatrixSet>
    <wellKnownScaleSet>Custom</wellKnownScaleSet>  
    <scales>1128.497176,564.248588,282.124294</scales>  
    <dpi>90.7142857142857</dpi>  
    <tileWidth>256</tileWidth>  
    <tileHeight>256</tileHeight>
    <matrixList>
        <com.supermap.services.wmts.TileMatrix>
            <identifier>19</identifier>
        </com.supermap.services.wmts.TileMatrix>
        <com.supermap.services.wmts.TileMatrix>
            <identifier>20</identifier>
        </com.supermap.services.wmts.TileMatrix>
        <com.supermap.services.wmts.TileMatrix>
            <identifier>21</identifier>
        </com.supermap.services.wmts.TileMatrix>
    </matrixList>
</com.supermap.services.wmts.TileMatrixSet> 

TileMatrix其他参数是否必填请自行尝试。

1,780EXP 2017年09月26日
已实现,谢谢毛工。

 <interface class="com.supermap.services.wmts.WMTSServlet" name="wmts101">
      <config class="com.supermap.services.wmts.WMTSConfig">
        <identification>
          <keywords/>
        </identification>  
        <provider>
          <serviceContact/>
        </provider>  
         
        <tileMatrixSets>
          <com.supermap.services.wmts.TileMatrixSet>
            <wellKnownScaleSet>Custom</wellKnownScaleSet>  
             <scales>1128.497176,564.248588,282.124294</scales>   
            <dpi>90.7142857142857</dpi>  
            <tileWidth>256</tileWidth>  
            <tileHeight>256</tileHeight>
            <matrixList>
              <com.supermap.services.wmts.TileMatrix>
                <identifier>19</identifier>        
             <matrixHeight>495422</matrixHeight>
             <matrixWidth>495422</matrixWidth>
             <resolution >0.3159792092800001</resolution >
             <scaleDenominator>1128.497176</scaleDenominator>             
            <tileWidth>256</tileWidth>  
            <tileHeight>256</tileHeight>    
            <topLeftCorner>-2.0037508342789244E7 2.0037508342789244E7</topLeftCorner>            
              </com.supermap.services.wmts.TileMatrix>
              
              <com.supermap.services.wmts.TileMatrix>
                <identifier>20</identifier>    
             <matrixHeight>990844</matrixHeight>
             <matrixWidth>990844</matrixWidth>
             <resolution >0.15798960464000006</resolution >
             <scaleDenominator>564.248588</scaleDenominator>             
            <tileWidth>256</tileWidth>  
            <tileHeight>256</tileHeight>    
            <topLeftCorner>-2.0037508342789244E7 2.0037508342789244E7</topLeftCorner>                    
              </com.supermap.services.wmts.TileMatrix>
              
              <com.supermap.services.wmts.TileMatrix>
                <identifier>21</identifier>                    
             <matrixHeight>1981688</matrixHeight>
             <matrixWidth>1981688</matrixWidth>
             <resolution >0.07899480232000003</resolution >
             <scaleDenominator>282.124294</scaleDenominator>             
            <tileWidth>256</tileWidth>  
            <tileHeight>256</tileHeight>    
            <topLeftCorner>-2.0037508342789244E7 2.0037508342789244E7</topLeftCorner>                    
              </com.supermap.services.wmts.TileMatrix>
            </matrixList>
          </com.supermap.services.wmts.TileMatrixSet>
        </tileMatrixSets>  
        <customEntireBounds>-2.0037508342789244E7,-2.0037508342789244E7,2.0037508342789244E7,2.0037508342789244E7</customEntireBounds>
        <verifyMode>DEFAULT</verifyMode>
      </config>
    </interface>
...