程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

瓦片地图之WMS服务(GeoWebCache)

发布于2021-06-12 15:20     阅读(18)     评论(0)     点赞(20)     收藏(0)


将瓦片地图存储为文件或数据库,在部署不同机器时,需要复制一份,为了部署方便,可以将地图发布为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下,修改如下:
  1. <bean id="gwcXmlConfig" class="org.geowebcache.config.XMLConfiguration">
  2. <constructor-arg ref="gwcAppCtx" />
  3. <!--<constructor-arg ref="gwcDefaultStorageFinder" />-->
  4. <constructor-arg value="D:\\GisMap\\" />
  5. <!-- By default GWC will look for geowebcache.xml in {GEOWEBCACHE_CACHE_DIR},
  6. if not found will look at GEOSEVER_DATA_DIR/gwc/
  7. alternatively you can specify an absolute or relative path to a directory
  8. by replacing the gwcDefaultStorageFinder constructor argument above by the directory
  9. path, like constructor-arg value="/etc/geowebcache"
  10. -->
  11. <property name="template" value="/geowebcache.xml">
  12. <description>Set the location of the template configuration file to copy over to the
  13. cache directory if one doesn't already exist.
  14. </description>
  15. </property>
  16. </bean>

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

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

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

  1. <arcgisLayer>
  2. <name>ARCGIS-Demo</name>
  3. <tilingScheme>D:\\GisMap\\Layer\\conf.xml</tilingScheme>
  4. <tileCachePath>D:\\GisMap\\Layer\\_alllayers</tileCachePath>
  5. </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】,出现下图

原文链接:https://blog.csdn.net/keebai/article/details/117709252



所属网站分类: 技术文章 > 博客

作者:niceboty

链接:http://www.javaheidong.com/blog/article/222425/93de5665f000ebb78ba9/

来源:java黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

20 0
收藏该文
已收藏

评论内容:(最多支持255个字符)