geowebcache发布 arcgis 瓦片

改为独立使用tomcat

参考 https://www.cnblogs.com/haolb123/p/14663029.html

arggis瓦片数据准备

1 导出时注意各个图层都导出,否则预览时可能有问题,报错 400 null

2 修改文件编码

conf.cdi

conf.xml
用nodepad++ 调整编码方式从utf-8 BOM 为
utf-8

前置条件:设置依赖的JRE。如11 略

1 下载tomcat

https://tomcat.apache.org/download-80.cgi

比如解压缩在D:apache-tomcat-8.5.69

2  下载geowebcache

官网下载 https://sourceforge.net/projects/geowebcache/files/geowebcache/

选择war

直接把这个文件夹复制到

D:apache-tomcat-8.5.69webapps 下

3 解压缩

3.1 启动 tomcat

在D:apache-tomcat-8.5.69in 运行 startup.bat (windows)

访问 http://127.0.0.1:8080/geowebcache  会看到网站启动成功

3.2 停止 tomcat 

3.3 删除 war文件

D:apache-tomcat-8.5.69webapps 下会解压缩出一个geowebcache 文件夹

在 D:apache-tomcat-8.5.69webapps 下 删除geowebcache.war文件

3.4 再次启动 tomcat

访问 http://127.0.0.1:8080/geowebcache  会看到网站启动成功

4 配置

4.1 创建空文件夹  可任意

D:\apache-tomcat-8.5.69\geowebcache\arcgis

 4.2 修改D:apache-tomcat-8.5.69webapps/geowebcache/WEB-INF文件夹下的文件web.xml

添加 路径和4.1一致

  <context-param>         
    <param-name>GEOWEBCACHE_CACHE_DIR</param-name>         
    <param-value>D:\apache-tomcat-8.5.69\geowebcache\arcgis</param-value>   
  </context-param>

4.2 修改D:apache-tomcat-8.5.69webapps/geowebcache/WEB-INF/geowebcache-core-context.xml 

添加

<bean id="gwcArcGIGridsetConfigutation" class="org.geowebcache.arcgis.layer.ArcGISCacheGridsetConfiguration"/>

4.3 重启 tomcat

D:\apache-tomcat-8.5.69\geowebcache\arcgis

下 创建出一些文件夹和文件,编辑

geowebcache.xml

在layers下添加

    <arcgisLayer>
        <name>08111044_ArcGIS</name>
        <tilingScheme>D:\dataset\gis\tile\arcgis\08111044_ArcGIS\conf.xml</tilingScheme>
        <tileCachePath>D:\dataset\gis\tile\arcgis\08111044_ArcGIS\_alllayers</tileCachePath>
        <hexZoom>false</hexZoom>
    </arcgisLayer>

路径是arcgis瓦片的路径

启动tomcat

http://127.0.0.1:8080/geowebcache/demo

选择 打开 刚发布的数据源

OpenLayers: [jpeg]

点击jpeg 应该可以看见地图

右键选择 查看源码,可以看到openlayer的代码,用来写自己的前端网页时参考

#------------------ 废弃 尝试直接集成在geoserver的不行,乱。 --------------------

参考

 https://blog.csdn.net/hellfire2007/article/details/80876785?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-5.control&spm=1001.2101.3001.4242

https://blog.csdn.net/mgsky1/article/details/80151316

https://www.daimajiaoliu.com/daima/60c1de6d7826001

但是各有矛盾杂乱的地方,自己搞一遍

1 安装geowebcache

先检查geoserver的版本说明

比如2.18.1

http://geoserver.org/announcements/2020/11/23/geoserver-2-18-1-released.html

明确说道:

We are pleased to announce the release of GeoServer 2.18.1 with downloads ( war | bin ), documentation and extensions.

This release is made in conjunction with GeoTools 24.1 and GeoWebCache 1.18.1. This is a stable release recommended for production systems.

Thanks to everyone who contributed, and Alessandro Parma, Andrea Aime (GeoSolutions) for making this release.

官网下载指定版本geowebcache https://sourceforge.net/projects/geowebcache/files/geowebcache/

选择 geowebcache-1.18.1-war.zip

下载之后,把war扩展名直接改为zip,直接解压成geowebcache文件夹

直接把这个文件夹复制到

geoserver-2.18.1-binwebapps 下

然后这下面有2个文件夹 

geoserver

geowebcache

启动geoserver

访问http://127.0.0.1:8080/geowebcache/

网页最下方显示

Storage Locations
Config file: XXXgeoserver-2.18.1-bindata_dirgwcgeowebcache.xml
Local Storage: XXXgeoserver-2.18.1-bindata_dirgwc

修改geowebcache.xml位置

按上面的路径复制geowebcache.xml 到别的位置,比如 D:MapTileDownloadOutPut

修改XXXgeoserver-2.18.1-binwebappsgeowebcacheWEB-INFgeowebcache-core-context.xml

  <bean id="gwcXmlConfig" class="org.geowebcache.config.XMLConfiguration">
    <constructor-arg ref="gwcAppCtx" />
    <!-- <constructor-arg ref="gwcDefaultStorageFinder" /> -->
    <constructor-arg value="D:MapTileDownloadOutPut" /> 

参考 https://blog.csdn.net/weixin_34075268/article/details/91725108

增加一行

  <bean id="gwcArcGIGridsetConfigutation" class="org.geowebcache.arcgis.layer.ArcGISCacheGridsetConfiguration"/>

重启,显示新的路径说明修改成功

参考 https://www.cnblogs.com/haolb123/p/14663029.html

 
 
—————————————
原文地址:https://www.cnblogs.com/xuanmanstein/p/15124707.html