Version 1.1.3 introduces new features and fixes minor bugs
Go to http://geowebcache.org/trac/wiki/Version1.1.3 to see a nicely formatted version of this document
GeoWebCache 1.1.3 adds some great new features sponsored by Statens Kartverk, the Norwegian Mapping and Cadastre Authority ( http://www.statkart.no ). Thanks to their generous support we have been able to implement two items from the menu, as well as a "gutter", a buffer of pixels around metatiles that is sliced away. The two other items are "format modifiers" and the ability to adjust JPEG compression. You can read more about these features below, but the most important thing is that they make your tiles look better when using JPEG. The key technique is to not retrieve JPEGs from the WMS server, but use TIFF or PNG, and then only apply JPEG compression in the last step. The ability to adjust the quality ratio offers additional control.
You can see OpenLayers, GeoWebCache and MapServer in action right on the front page of their website.
You may have noticed that there was no explicit release of 1.1.2. The latter was rushed into GeoServer 1.7.5, and since the work on 1.1.3 was expected to start shortly thereafter I skipped the release of 1.1.2.
Summary of changes, in reverse order of appearance
* Fixed content type check for image/png formats. Anything that starts with image/png is now accepted as a reponse from the WMS server
* Fixed image/png mode=24bit; , the space in this format was previously no correctly encoded
* Fixed metatiling bug in seeder. The tiler did not start at the closest metatile boundary and could stop prematurely. This mean that slightly less than one metatile could be missing on the upper and right hand edges of the area that was requested to be seed. This would then get dynamically seeded in most cases, so it was difficult to notice.
* Added support for format modifiers. See below
* Added support for gutter. See below
* Switched H2 database to auto mode by default. In theory this means that more one GWC instance can use the same cache directory.
* Added GWC_BLANK_TILE_PATH , a variable that can be set in the environment or web.xml. It allows you to specify what image file is to be used instead of the standard 8 bit transparent PNG. Note that content type response is currently hardcoded to say image/png.
* Fixed KML service linking to tiles below the specified zoom level. The hierarchy now stops as defined in the EPSG:4326 grid
Format Modifiers
WMS allows certain settings that make more sense for some formats than for others. In particular, TRANSPARENT is only meaningful if the formats supports transparency, and BGROUND (background) only makes sense if the format is not transparent. To get the best of both worlds, for two different formats, you previously had to define as two separate layers in the GeoWebCache configuration. Additionally, you can tell GeoWebCache to use a different format when requesting the metatiles from the backend.
The example below is from. Note that format modifiers can be inserted on a per-layer basis (following </mimeFormats>) or on the global level (before <layers>). See the XSD documentation for details, http://geowebcache.org/schema/docs/1.1.3
<formatModifiers>
<formatModifier>
<!-- Mandatory, the format requested by client -->
<responseFormat>image/jpeg</responseFormat>
<!-- Optional, the format GWC will use to get metatiles from backend,
This allows you to avoid lossy compression, such as JPEG, to be
applied twice. Use image/png; mode=24bit for MapServer -->
<requestFormat>image/png</requestFormat>
<!-- Optional, override transparent parameter in WMS request -->
<transparent>false</transparent>
<!-- Optional, override or set backgroud color for WMS request.
The following uses a light grey background -->
<bgColor>0xDDDDDD</bgColor>
<!-- Optional, override or set palette parameter for WMS request -->
<palette>webSafePalette</palette>
<!-- Optional, adjust the compression ratio used when saving
the tiles. For minimum compression use 1.0 -->
<compressionQuality>1.0</compressionQuality>
</formatModifier>
</formatModifiers>
JPEG Quality Control
The JPEG encoder that ships with Java appears to default to a quality ratio of 0.75. This can be adjusted by using a format modifier, the suggested configuration for high quality tiles is
<formatModifiers>
<formatModifier>
<responseFormat>image/jpeg</responseFormat>
<requestFormat>image/png</requestFormat>
<compressionQuality>0.85</compressionQuality>
<formatModifier>
</formatModifiers>
If the layer is potentially transparent, you should add the following before <compressionQuality>:
<transparent>false</transparent>
<bgColor>0xFFFFFF</bgColor>
Gutter
The gutter is defined on a per-layer basis. It is a buffer that is added to the WMS request to the backend, and then sliced away when the tiles are saved to disk. This feature can improve the appearance by avoiding edge effects. It may cause problems if you have polygons that are labeled multiple times. In particular, it was implemented for use with MapServer?.
So if you have 3x3 metatiling and the tiles are 256x256, the metatile would normally be 768x768. With a 20px buffer this changes to 808x808. Note that GeoWebCache respects the layer bounds, to avoid exceeding the bounds that the WMS server can handle.
--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers