[MapProxy] Cache is storing in the incorrect format
Ryan How
ryan at bitworks.com.au
Wed Jun 14 22:49:53 PDT 2017
Hi Again,
I discovered that setting a cache to JPEG with a tile source that is PNG
results in the cache storing tiles in PNG format (and naming them as
.jpeg). The resulted images served to the browser are also in PNG even
though the cache is set to JPEG.
I worked around this by creating a cache for this source, then another
cache pointing to this cache. This seemed a bit counter-intuitive to me.
I just want to know if this is how it is supposed to work?
I can just turn off storage for the intermediate cache with
disable_storage: true.
It just had me confused for a while why my tiles were all in png, when I
specifically have specified jpeg.
The configuration snippet is:
sources:
tms1:
type: tile
grid: GLOBAL_WEBMERCATOR
supported_formats: [image/png]
format: image/png
url: https://example.com/%(z)s/%(x)s/%(y)s.png
transparent: true
caches:
cache1: #This cache is storing the tiles as PNG encoded, even though
they are named as jpeg
format: image/jpeg
meta_size: [1, 1] #So I can isolate the time for a single tile
request_format: image/jpeg
grids: [webmercator]
sources: [tms1]
A working configuration is:
sources:
tms1:
type: tile
grid: GLOBAL_WEBMERCATOR
supported_formats: [image/png]
format: image/png
url: https://example.com/%(z)s/%(x)s/%(y)s.png
transparent: true
caches:
cache1:
format: image/png
request_format: image/png
grids: [webmercator]
sources: [tms1]
cache2:
format: image/jpeg
request_format: image/jpeg
grids: [webmercator]
sources: [cache1]
Thanks, Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20170615/1e1bceac/attachment.html>
More information about the MapProxy
mailing list