将瓦片地图存储为文件或数据库,在部署不同机器时,需要复制一份,为了部署方便,可以将地图发布为WMS服务。这样,局域网内的电脑均可利用该地图数据。
参考:https://www.freesion.com/article/7812301331/
https://www.cnblogs.com/luxiaoxun/p/5022333.html
过程如下:
利用Geowebcache+Tomacat+分极瓦片地图数据部署
- 下载tomcat,解压,启动bin目录下的starup.tbat,在浏览器中输入http://localhost:8080可访问
- 官网下载 geowebcache-1.8.0-war.zip,直接解压得到geowebcache.war文件,将该文件直接拷贝至tomcat目录下的webapps下即可,启动tomcat会对war包进行解压。
- 修改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】,出现下图