[MapProxy] Cache is storing in the incorrect format

Oliver Tonnhofer olt at omniscale.de
Mon Jun 19 23:26:05 PDT 2017


Hi,

tiles form tile sources are stored as-is, as the format and supported_formats options are not supported for tile sources (you should see a warning in the log output). 

Regards,
Oliver

-- 
Oliver Tonnhofer  | Omniscale GmbH & Co KG  | https://omniscale.com
OpenStreetMap WMS and tile services         | https://maps.omniscale.com





> On 15.06.2017, at 07:49, Ryan How <ryan at bitworks.com.au> wrote:
> 
> 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
> 
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapproxy



More information about the MapProxy mailing list