zoukankan      html  css  js  c++  java
  • GeoServer——Accelerate your maps with GeoWebCache!

    Accelerate your maps with GeoWebCache!

    Introduction

    GeoWebCache is a WMS tiling client. It runs as a proxy server between a map client and map server, caching tiles as they are requested, thus saving vast amounts of processing time. Written in Java, GeoWebCache is available as a standalone product which can be integrated with many client/server combinations.  However, GeoWebCache is also an extension that has been shipped with GeoServer since version 1.7.0.

    Users are strongly encouraged to upgrade to 1.7.1a or greater. As of GeoServer 1.7.2, GeoWebCache can also act as a non-caching translator for Google Maps and MS Virtual Earth clients. See the links at the bottom of this page for details.

    Installation

    1. By default, GeoWebCache expects GeoServer to be accessible at the following URL:
      http://localhost:8080/geoserver
      

      To point GeoWebCache elsewhere, add the following code to the web.xml file:

      <context-param>
          <param-name>GEOSERVER_WMS_URL</param-name>
          <param-value>http://EXAMPLE.COM:PORT/PATH/wms?request=GetCapabilities</param-value>
      </context-param>
      

      Make sure to replace the URL inside <param-value> with your GeoServer instance's WMS GetCapabilities path.

    2. By default GeoWebCache will store cached tiles in this path: %GEOSERVER_DATA_DIR%/gwc. To change this, add the following code to web.xml:
      <context-param>
          <param-name>GEOWEBCACHE_CACHE_DIR</param-name>
          <param-value>c:\temp</param-value>
      </context-param>
      

       Make sure to change %CACHE_PATH% to the path you wish to store your tiles (Examples:  /tmp, C:\temp)

    3. (Re)start your instance of GeoServer.

    Using GeoWebCache

    To get an overview of what GeoWebCache can do for you, point your browser to:  

    http://localhost:8080/geoserver/gwc/demo
    

    The demos on this page are not exhaustive, but should give you an idea of what is available.

    In general, using GeoWebCache with a tiling client only requires you to change the WMS URL.  For example, if your application requests WMS tiles at the following URL:

    http://example.com:8080/geoserver/wms
    

    To instead invoke GeoWebCache from a tiling client that uses one of the global profiles of the WMS-C Tiling Client recommendations, use:

    http://example.com:8080/geoserver/gwc/service/wms
    

    If you run into problems, such as error messages saying that the resolution is not supported or the bounds do not align, then your client is most likely not making requests that align with the grid of tiles that GeoWebCache has created. If you are using OpenLayers then you should look at the source code of the automatically created demos. The most common problems is that the map or layer bounds differ from those of the grid, or that the resolution (derived from bounds, maxresolution or minresolution) is not correct.

    As soon as tiles are requested through GeoWebCache, it automatically starts caching them.  These tiles are stored by default in the %GEOSERVER_DATA_DIR%/gwc path, with each FeatureType in its own subdirectory.  As more tiles are requested for each FeatureType, the size of this directory will grow.

    Refreshing Data

    On the demo page there is a link to "Seed this layer". Accessing it requires you to provide the username and password of the administrative user in GeoServer. Your three options are

    • Seed - Adds missing tiles, but does not overwrite existing ones
    • Reseed - Like seed, but overwrites existing tiles
    • Truncate - Deletes all tiles within the given bounds and zoomlevels

    If you have direct access to the filesystem on the server, you can also delete the appropriate layers in the cache directory.

    On the demo page there is also a reload button. Use this if you have added layers in GeoServer.

    Projections and Other Parameters

    The integrated version of GeoWebCache automatically configures every layer with the two most common projections:

    • EPSG:4326 (standard Latitude/Longitude)
    • EPSG:900913 (Spherical Mercator, the projection used in Google Maps)

    If you need additional projections you can create a configuration file called geowebcache.xml  in the cache directory, for example  /var/geoserver_data/gwc/geowebcache.xml

    This configuration file is the same as used by the standalone version of GeoWebCache and documented on http://geowebcache.org/  To avoid collisions, the layers in this file should be named differently from the ones that are automatically loaded from GeoServer

    The configuration syntax directly supports the most common WMS parameters, such as background color, style and palette. If you need something like a CQL filter you should use the vendorParameters option.

    More Information

    Please see the GeoWebCache site at geowebcache.org.  The Documentationpage contains examples for integration with:

    转载自:http://geoserver.org/display/GEOSDOC/5.+GWC+-+GeoWebCache

  • 相关阅读:
    将不确定变成确定~LINQ DBML模型可以对应多个数据库吗
    将不确定变成确定~frameset页面不能正确加载
    System.Web.Caching.Cache删除某键后,希望同时触发其它动作(关键时刻,还是事件靠的住)
    Linq实体类的设计(解决了复合查询的问题,同时解决了LINQ上下文缓存问题)
    将不确定变成确定~LINQ查询两种写法,性能没有影响,优化查询应该是“按需查询”
    ASP.NET的内置对象
    Templating with JSF 2.0 Facelets
    IOS设计模式学习(1)设计模式初窥
    20个强大的jQuery翻书插件【 jQuery flipbook】
    linux网络编程之socket(十四):基于UDP协议的网络程序
  • 原文地址:https://www.cnblogs.com/wuhenke/p/1766366.html
Copyright © 2011-2022 走看看