Home | Products | Issue Tracker | FAQ | Download | |
Date: | 2013/04/15 |
---|---|
Author: | Thomas Bonfort |
Contact: | thomas.bonfort@gmail.com |
Status: | Adopted |
Version: | MapCache 1.2 |
When tiling raster data, it is common for the native resolution of the original data to be somewhat/much lower than the resolutions of the higher zoom levels of the standard GoogleMapsCompatible or WGS84 grids. Users whishing to serve low resolution data at high resolutions are currently forced to use one of these approaches:
This RFC proposes to add the concept of “maximum cached level” for a given tileset and a given grid. In practice, tiles above the configured maximum cached level are still transparently available for an end user or when vertically merging multiple tiles, however they are dynamically upscaled from the maximum cached level instead of being cached on the mapcache instance (after having been requested once from the source WMS service).
In order to be available for all tile operations, the mapcache_tileset_tile_get function will detect calls that are over the maximum cached level and fall back to a new function who’s responsibility is to treat this special case. Two configurations will be available for this “over the maximum cached zoom” scenario:
Activating this functionality in the configuration file is done for each grid referenced by a tileset:
<tileset>
<!-- ... -->
<grid max-cached-zoom="12" out-of-zoom-strategy="reassemble">WGS84</grid>
<grid max-cached-zoom="12" out-of-zoom-strategy="proxy">g</grid> <!-- not implemented -->
<!-- ... -->
</tileset>
Two new functions will be added, and will produce a tile’s image by either upscaling lower level tiles or directly querying the source wms. They will be called from the mapcache_tileset_tile_get() function when such a behavior has been requested in the configuration file.
None expected, new functionality
When upscaling tiles, each tile request will imply at least one image decompression and one image compression, along with bilinear resampling on the image data. Servicing upsampled tiles will therefore be orders of magnitude slower than directly serving them from a cache.
It should be possible to deactivate bilinear resampling for users wanting better performance at the cost of degraded output quality. This could be adressed in a later phase should that need arise.
+1 from ThomasB, StephanM, MikeS, TomK, JeffM, DanielM, PerryN and SteveW