GeoWebCache教程
GeoWebCache 1.15.2
GeoWebCache is a Java web application used to cache map tiles coming from a variety of sources such as OGC Web Map Server (WMS). It implements various service interfaces (such as WMS-C, WMTS, TMS, Google Maps KML, Virtual Earth) in order to accelerate and optimize map image delivery. It can also recombine tiles to work with regular WMS clients.
This User Manual is a guide to the most common aspects of GeoWebCache.
GeoWebCache只是拦截并缓存切⽚,⾃⼰并不能⽣成切⽚吧?那切⽚是谁⽣成的?
(简介)
(GeoWebCache是什么?)
(架构)
(社区)
(单独安装vsGeoServer集成)
(安装)
(安装Java和Tomcat)
(安装GeoWebCache)
(从1.15前的版本升级)
(从1.4版本前升级)
(快速上⼿)
查看预配置的图层
查看WMS的图层
特殊例⼦
eclipse安装教程tomcat额外信息
(概念)
(切⽚)
(格⽹集和格⽹⼦集)
(元切⽚)
(存储组件)
(操作)
配置)
配置图层
安全
存储
开启/禁⽌服务
硬盘Quotas
重新加载配置
⽹页UI
状态页
Demo页
Seed页
服务
WMS-⽹络地图服务
WMS-C-切⽚客户端
WMTS-⽹络地图切⽚服务
TMS切图服务
KML
⾕歌地图
必应地图
移动G地图
特殊的HTTP响应头
REST接⼝
通过REST API管理全局服务器配置
通过REST API管理图层
通过REST API管理GridSets
通过REST API管理BlobStores
通过REST API进⾏seed和truncate
查询运⾏的任务
终⽌运⾏的任务
硬盘查询REST API
批量Truncation
在内存中的缓存的统计
格式和展⽰
认证
状态码
⽣产
运⾏环境
硬件考量
运⾏系统设置
缓存的播种与裁切
资源配置
聚类
故障处理
配置问题
不正确或有损的切⽚
⽇志
X流
获取帮助
⼆次开发
设置
设置Eclipse
贡献补丁
经常被问到的问题
⼀、
Introduction简介
This section introduces GeoWebCache, what it is, how it works, and its community of users.
本部分介绍GeoWebCache,它是什么,它是如何⼯作的,以及它的⽤户社区。
GeoWebCache是什么?
架构
简介
请求过程
社区
主页
邮件列表
IRC
源码
问题追踪
许可证
单独vsGeoserver集成的
你应该选择哪个GeoWebCache?
⼆、
Installation安装
This section describes how to install GeoWebCache on the most common platforms. GeoWebCache will work on any operating system that supports Java 1.5, including FreeBSD and Solaris.
本部分描述了如何安装GeoWebCache在绝⼤多数平台。GeoWebCache将运⾏在任何⽀持Java1.5的操作系统之上。包括FreeBSD和Solaris。
The following software will need to be set up prior to installing GeoWebCache:
以下的软件需要提前安装:
Java Runtime Environment (JRE) (version 1.5 or greater, preferably from Oracle)
Java Servlet Container (such as Apache Tomcat)
In essence, GeoWebCache is a set of Java classes (program files) and a number of configuration files. The combination is known as a Java Servlet, and these are commonly distributed in a zip file known as a Web ARchive, or WAR file for short.
实际上,geowebache是⼀组Java类(程序⽂件)和⼀些配置⽂件。这种组合称为javaservlet,它们通常分布在⼀个zip⽂件中,称为webarchive,简称WAR⽂件。
To use its content, we need a Java Virtual Machine and a Servlet Container. The latter is a network service that accepts requests from
clients, such as web browsers, and delegates them to the appropriate servlet.
为了使⽤它的内容,我们需要⼀个Java虚拟机和⼀个Servlet容器。后者是⼀种⽹络服务,它接受来⾃客户端(如web浏览器)的请求,并将它们委托给适当的servlet。
安装Java和Tomcat
Linux
Windows
MacOS X
安装GeoWebCache
Once the is in place, installing GeoWebCache is simple.
⼀旦Java Servlet环境搭好了,那么安装GeoWebCache是很简单的。
The latest Web ARchive (WAR) file can be downloaded from .
最新的Web ARchive(WAR)⽂件可以从下载。
Unpack the zip file and make sure to read the software .
解压zip⽂件,并确保阅读过软件许可。
选项1:Tomcat管理员⼯具
(2)Find the section WAR file to deploy, and upload geowebcache.war you unpacked from the zip file.
(3)After the upload is complete, look for geowebcache in the Applications table.
选项2:⼈⼯安装
从1.15前的版本升级
从1.4版本前升级
三、
Quickstart快速上⼿
This section describes how to get quickly started with GeoWebCache without knowing much about the .
本部分描述了如何快速上⼿GeoWebCache,⽽⽆需知道太多配置⽅⾯。
All servers conforming to the publish what is known as a capabilities document (sometimes also known as a GetCapabilities document after the request used to fetch it). This is an XML file that describes the layers exposed by the WMS service and available to the user. GeoWebCache can use this information to configure itself automatically.
所有符合OGC Web Map服务规范的服务器都会发布称为capabilities⽂档的内容(有时以在⽤于获取它的请求之后命名也称为GetCapabilities⽂档)。这是⼀个XML⽂件,它描述了WMS服务公开并可供⽤户使⽤的图层。GeoWebCache可以使⽤此信息⾃动配置⾃⾝。
View preconfigured layers查看预先配置的图层
Layer Name (Title)WMS layer(s)
img states nurc:Img_Sample,topp:states
raster test layer nurc:Img_Sample
topp:states topp:states
Note注意
This information is set in l file, which is typically available at opt/apache-tomcat-6.0.29/webapps/geowebcache/WEB-
INF/classes or C:\Program Files\Apache Software Foundation\Tomcat 6.0.29\webapps\geowebcache\WEB-INF\classes. See the section on for more information on customizing this file.
该信息是在l⽂件中设置的,它通常是在opt/apache-tomcat-6.029/webapps/geowebcache/WEB-INF/classes或者
C:\Program Files\Apache Software Foundation\Tomcat 6.0.29\webapps\geowebcache\WEB-INF\classes。查看Configuring Layers更多配置该⽂件的信息。
View layers from a WMS查看来⾃WMS的图层
The l is a configuration file controling how the application is loaded. It is located inside the WEB-INF folder, typically /opt/apache-tomcat-6.0.29/webapps/geowebcache/WEB-INF/ or C:\Program Files\Apache Software Foundation\Tomcat 6.0.29\webapps\geowebcache\WEB-INF along with several other configuration files.
⽂件l是⼀个配置⽂件,控制程序如何加载的。它位于WEB-INF⽂件夹中,通常位于/opt/apache-tomcat-
6.0.29/webapps/geowebcache/WEB-INF/或者C:\Program Files\Apache Software Foundation\Tomcat 6.0.29\webapps\geowebcache\WEB-INF。跟它在同⼀⽬录的还有其它配置⽂件。
1. l in a text editor.在⽂本编辑器中打开l
Note
If using Windows, it is recommended to use an enhanced text editor such as or instead of the standard Windows Notepad.
2. Find the block beginning with:你会发现该⽂件以以下开头:
<bean id="gwcWMSConfig" class="fig.wms.GetCapabilitiesConfiguration">
On the second line you will see a value that contains a URL:在第⼆⾏你会看到⼀个值包含URL:
<constructor-arg value="localhost:8282/geoserver/wms?request=getcapabilities&version=1.1.0&service=wms" />
3. Replace the value with a URL pointing to a valid WMS capabilities document, such as:替换该值以⼀个URL指向⼀个有效的WMS
capabilities⽂件,例如:
<constructor-arg value="/geoserver/ows?service=WMS&request=GetCapabilities&version=1.1.0" />
Warning
The ampersand sign, & has to be written out as & in XML files. Also, make sure to omit the line breaks.
4. Save the file and reload the servlet using Tomcat’s Manager, or by restarting the servlet container.
5. Navigate to or reload your GeoWebCache demo page. You should see the list of layers as advertised in the WMS capabilities
document.
Special cases特殊例⼦
Below are some extra parameters that may be needed or that you may want to add to get your WMS layers loading properly in GeoWebCache.
以下是⼀些可能需要的额外的参数,或者你可能想要添加到你的⽂件中从⽽让你的WMS图层合理的加载到GeoWebCache中。
Map vendor parameters映射供应商参数
If your WMS server requires additional vendor parameters to be passed with every request, such as MapServer’s map argument, set this in the fifth constructor-arg value.
如果你的WMS服务器需要额外的供应参数,每次请求都要带上,例如MapServer的map参数,设置它为第五个constructor-arg值。Replace:
<constructor-arg value=""/>
with:
<constructor-arg value="map=name&otherkey=othervalue"/>
Cached vendor parameters缓存的供应商参数
By default vendor parameters included in requests are ignored. To pass on the value of a vendor parameter to your wms server, and cache the result seperately depending on the given value, set the sixth constructor-arg value.
默认情况下,包含在请求中的供应参数是被忽略的。要传递供应参数到你的wms服务器,并且根据给定的值分开单独缓存结果,设置第六个constructor-arg值。
For each cached vender parameter add a line between the <map> tags of the form:
对于每⼀个缓存的供应参数,添加⼀⾏在<map>标签中:
<entry key="parameterName" value="defaultvalue" />
Other image formats其它的图⽚格式
To get 24 bit PNGs from MapServer or ArcIMS (image/png; mode=24bit and image/png24 respectively), or any other image format, you will need to specify those as output formats. This is set in the fourth constructor-arg value. Replace:
要从MapServer或者ArcIMS(image/png;mode=24bit和image/png24分别)获取24位的PNG,或者是其他图⽚格式,你将需要指定这些为输出格式。这个设置是在第四个constructor-arg值。取代:
<constructor-arg value="image/png,image/jpeg"/>
with为:
<constructor-arg value="image/png; mode=24bit,image/png24,image/jpeg"/>
Other MIME types can be specified here as well.
其他的MIME类型也可以在这⾥指定。
Metatile factor元切⽚因⼦
The metatiling factor can be modified by editing the third constructor-arg value. This will affect all layers derived from this document. See
the section for more information.
元切⽚因⼦可以通过编辑第三个constructor-arg值来进⾏修改。这将影响所有的图层。查看元切⽚⼀节获取更多信息。
Multiple capabilities documents多capabilities⽂档
GeoWebCache can be configured from multiple capabilities documents. To do this, you can duplicate the gwcWMSConfig bean with a new id: gwcWMSConfig2 for instance.
GeoWebCache可以通过多capabilities⽂档来进⾏配置。要做到这⼀点,你可以⽤⼀个新的id:gwcWMSConfig2来复制gwcWMSConfig bean。
Additional information额外的信息
All layers known to GeoWebCache should be available on the demo page, along with automatically configured OpenLayers clients. The KML demos use the same sets of tiles as the OpenLayers EPSG:4326 demo.
GeoWebCache已知的所有层都应该在演⽰页⾯上提供,以及⾃动配置的OpenLayers客户端。KML演⽰使⽤与OpenLayers EPSG:4326演⽰相同的瓷砖集。
According to the WMS standard, the capabilities document is only guaranteed to contain the WGS84 (lat/lon) bounds for a layer, hence EPSG:4326, though in rare cases the WMS server will not be able to provide responses for this projection. If the capabilities document contains bounding boxes for additional projections, often the native reference system for the data, then these will be included as well. Finally, GeoWebCache will convert the EPSG:4326 bounding box to spherical mercator (EPSG:900913, now officially known as EPSG:3857). That said, the WMS server isn’t guaranteed to be able to provide a successful response to these requests.
根据WMS标准,能⼒⽂档只保证包含⼀个层的WGS84(lat/lon)界限,因此EPSG:4326,尽管在极少数情况下WMS服务器将⽆法对此投影提供响应。如果capabilities⽂档包含附加投影的边界框,通常是数据的本机参考系统,那么这些也将包括在内。最后,GeoWebCache将EPSG:4326边界框转换为球形墨
卡托(EPSG:900913,现在正式称为EPSG:3857)。也就是说,WMS服务器不能保证能够成功响应这些请求。
If you need to support other projections, you can do so by defining grid sets manually and adding them to these layers. The same is true for supporting specific resolutions, output formats or tile sizes. See the section for more information.
如果需要⽀持其他投影,可以通过⼿动定义栅格集并将其添加到这些图层来实现。对于⽀持特定分辨率、输出格式或平铺⼤⼩也是如此。有关更多信息,请参阅配置部分。
四、
Concepts概念
This section explains some general concepts used when tiling, as well as special idioms used in GeoWebCache.
本部分解释了⼀些切图时基本的概念。还有⼀些GeoWebCache中使⽤的特殊俗语。
切⽚
GeoWebCache caches images retrieved from a WMS. The smallest unit of image cached is known as a tile. All tiles are assumed to be the same dimensions and are typically square (i.e. 256 pixels by 256 pixels).
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论