瓦片地图之WMS服务(GeoWebCache)

将瓦片地图存储为文件或数据库,在部署不同机器时,需要复制一份,为了部署方便,可以将地图发布为WMS服务。这样,局域网内的电脑均可利用该地图数据。

参考:https://www.freesion.com/article/7812301331/

https://www.cnblogs.com/luxiaoxun/p/5022333.html

 

过程如下:

利用Geowebcache+Tomacat+分极瓦片地图数据部署

 

  1. 下载tomcat,解压,启动bin目录下的starup.tbat,在浏览器中输入http://localhost:8080可访问
  2. 官网下载 geowebcache-1.8.0-war.zip,直接解压得到geowebcache.war文件,将该文件直接拷贝至tomcat目录下的webapps下即可,启动tomcat会对war包进行解压。
  3. 修改geowebcache的配置文件geowebcache-core-context.xml。该文件在Tomcat的webapps\geowebcache\WEB-INF下,修改如下:
<bean id="gwcXmlConfig" class="org.geowebcache.config.XMLConfiguration">
<constructor-arg ref="gwcAppCtx" />
<!--<constructor-arg ref="gwcDefaultStorageFinder" />-->
    <constructor-arg value="D:\\GisMap\\" />
<!-- By default GWC will look for geowebcache.xml in {GEOWEBCACHE_CACHE_DIR},
         if not found will look at GEOSEVER_DATA_DIR/gwc/
         alternatively you can specify an absolute or relative path to a directory
         by replacing the gwcDefaultStorageFinder constructor argument above by the directory
         path, like constructor-arg value="/etc/geowebcache"     
    -->
<property name="template" value="/geowebcache.xml">
<description>Set the location of the template configuration file to copy over to the
        cache directory if one doesn't already exist.
</description>
</property>
</bean>

<constructor-arg>使用固定路径,该路径可以为任意新建路径文件夹。Geowebcache启动之后会检查此文件夹下是否存在gewebcache.xml文件,如果不存在则按模板新建立并读取使用,如果存在则直接读取使用.

4. 启动Tomacat,这时会在 <contructor-arg> value目录下生成gewebcache.xml文件。然后关闭tomacat

5. 打开gewebcache.xml,在<layers>下增加:


    <arcgisLayer>
        <name>ARCGIS-Demo</name>
        <tilingScheme>D:\\GisMap\\Layer\\conf.xml</tilingScheme>
        <tileCachePath>D:\\GisMap\\Layer\\_alllayers</tileCachePath>
    </arcgisLayer>

<name>随着起, <tilingScheme>和<tileCachePath>对应瓦片地图的文件及目录

6. 瓦片地图由全能地图下载瓦片后,通过工具菜单中的拼图,导出为AcrGIS Server缓存瓦片。结构如下

注意:把conf.xml 和conf.cdi的编码格式改为不带BOM的UTF-8,不然web服务器访问不到

7. 启动tomcat,继而启动Geowebcache服务,浏览器访问 localhost:8080/geowebcache,如果一切正确的话可以看到下面的页面:

8. 点击 

出现:

9. 点击Seed this layer:如下图:

注意,该地图数据 的投影方式为EPSG:3857。

10.点击【jpeg】,出现下图

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值