Developer’s Corner: Improved GeoWebCache quality for full WMS requests

GeoSolutions

Hi all,

We would present some improvements on GeoWebCache which we have developed lately.

GeoWebCache is a software which can be added to GeoServer for caching the requested tile in memory and reducing the tile retrieval time. A particular feature of this software is the ability to make WMS requests directly integrated with GeoServer WMS. This functionality can be executed in 2 different modalities: WMS-C and full WMS. WMS-C requests only returns the already cached tiles at the already defined resolutions; on the opposite, full WMS requests can return all the tiles at an arbitrary resolution.

The full WMS configuration takes all the layer tiles, cached or not; tiles which are not in cache are requested to GeoServer. The ability to serve arbitrary resolution is achieved in 2 steps. The first step consists of taking the tiles at the best suitable resolution and mosaicking them into a single image. When the mosaic is prepared, the final image is scaled to the requested resolution.

By default no RenderingHints are defined for the mosaic and the scale operations; these hints are a group of parameters which can be used for changing the behaviour of an operation on an image. With our modifications you can choose between 3 different configurations for the rendering hints:

  • configuration for a best image quality;
  • configuration for a best response speed;
  • configuration for a trade off between quality and speed.

These 3 configurations can be selected by adding to the WMS request one of the 3 following parameters &hints=quality/&hints=speed/&hints=default. The first parameter returns the result with a better quality than the other 2 configurations, but taking more time in respect to them. On the opposite the second parameter allow GeoWebCache to return the response quickly with a bad image quality. The last parameter provides a trade-off between the other 2 parameters by returning an image with a better quality than that of the speed configuration in a faster time than that of the quality configuration.

Before our modifications, GeoWebCache was by default set to WMS-C, but now the user can simply add the following XML code <fullWMS>TRUE</fullWMS> to the geowebcache.xml configuration file for enabling the full WMS configuration.

With this change the user can now see the result of our improvement on GeoWebCache. All the tests has been performed on a line vector layer that can be downloaded from here, the style used for displaying these lines is a mix of some styles presented here.

On the old GeoWebCache code, a full WMS request on this layer resulted in the following image (click on the images for seeing them at full resolution):

oldwms

The results returned by the new GeoWebCache WMS can be viewed below.

Speed Configuration

newwmsSpeed

Default Configuration

newwmsDefault

Quality Configuration

newwmsQuality

 

From the images above you can easily note that the old version of GeoWebCache returns an image with a quality similar to that of the Speed configuration. The other images show that, with this new parameter, the quality for each image is really increased, especially for the Quality configuration.

So we can conclude that the use of these 3 configurations makes the user more free to choose how to display the image and gives the possibility to display images with a better quality than that of the old GeoWebCache. The size of the images is for Speed and Quality settings is similar to the size we were able to achieve previously, while the size for the Quality setting is, of course, slightly bigger as more quality means more antialiasing hence more translucent colors.

If you are interested in learning about how we can help you achieving your goals with our Open Source products and professional services, do not hesitate to contact us!

The GeoSolutions team,