[MapProxy] Limit cache storage up to fixed resolution

Just van den Broecke just at justobjects.nl
Mon Jul 3 03:33:41 PDT 2017


Hi,

I can confirm that Oliver's suggestion (see below) to use 2 caches 
works! So in summary: to limit a cache to store up to a fixed resolution:

"you can create a cache with a limited grid (last level 0.42) and 
another cache with your full grid. The second cache can use the first 
cache as a source and also use disable_storage."

Example MP config:

layers:
   - name: mylayer
     title: My Title ...
     sources: [full_cache]

caches:
   full_cache:
     grids: [full_grid]
     disable_storage: true
     sources: [mbtiles_cache]
     format: image/jpeg

   mbtiles_cache:
     grids: [limited_grid]
     sources: [my_wms]
     format: image/jpeg
     cache:
       type: mbtiles
       filename: my.mbtiles

Best,

Just van den Broecke

On 22-06-17 12:05, Just van den Broecke wrote:
> On 22-06-17 09:59, Oliver Tonnhofer wrote:
>> Hi,
>>
>>> On 22.06.2017, at 08:25, Santiago Horcajo
>>> <santiago.horcajo at gmail.com> wrote:
>>>
>>> Hi, I've got a doubt regarding the solution provided by Oliver.
>>
>> It's not that difficult to try it out :)
> Still todo, aim is somewhere over the weekend.
>>
>>> If the second cache has a source cache that has a limited grid, how
>>> can I go beyond the levels limited by this cache?
>>
>> It's how a cache in MapProxy works. MapProxy can "request" images from
>> a cache in any size, SRS and BBOX. The cache resamples and reprojects
>> images as necessary.
>> This happens when you make a cache available via WMS, or when you use
>> a cache as the source of another cache.
> Proof will be in the pudding...:-)
>>
>>
>>> Should I suppose that limited grid cache will give me tiles from the
>>> levels that it's not configured to render?
>>
>> Not directly tiles, but images. The WMTS, TMS and WMS-C service will
>> only provide tiles that are  configured with the grid.
> Think I see. So it will not consult the WMS but resample from cache?
> (will monitor what actually happens)
>
> Possibly a future cache option like "resample_from_level/_res" for a
> single full-grid 0-M level cache that:
> - stores only levels 0-N
> - "blows up" tiles from level N for levels N+1 - M.
> - resampling options
>
> Idea is that no WMS is then needed, but may be processing-expensive..
> Something like OpenLayers client does with "Layer.serverresolutions"
> (but is unfortunately hardly used, exhausting many caches..). But first
> will try-out Oliver's "2-cache suggestion"...
>
>>
>>
>> Regards,
>> Oliver
>>
>
> Best,
>
> --Just
>
> Just van den Broecke
> The Netherlands
> http://www.justobjects.nl
>
>
>
>
>
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapproxy









More information about the MapProxy mailing list