[MapProxy] Dealing with a source with multiple resolutions in one layer

Benjamin Wragg bwragg at isasolutions.com.au
Sun Aug 12 13:05:47 PDT 2012

Hi Paul,

> How did you set up the layer that combined all of them?

I combined them all in one layer by just doing the following in my layer definition:

  name: layer_name
  title: layer description
  sources: [whole_earth_cache, detailed_area1_cache, detailed_area2_cache]

As I understand it, with the above setup, if I request the tiles of a certain area it would:
1) get all the tiles of whole_earth_cache
2) if there are some tiles in detailed_area1_cache it gets all the corresponding tiles and layers them over the top
3) if there are some tiles in detailed_area2_cache it gets all the corresponding tiles and layers them over the top

so the resulting tile images that get served out are a mix of all 3 caches. 

> Also, when you say you set up a cache for the detailed area, how did you specify the extent of the detailed area? I don’t see anything in the caches docs about specifying coverage.

In my setup I precache everything I need as my users run offline without internet access, so I setup the extent in my seed.yaml. In this file you can define a coverage like:

    ogr_datasource: /path to shapefile.shp
    ogr_srs 'EPSG:code_of_projection'
    ogr_where: 'field_name = "my area of interest'

then in the seed.yaml you can setup a seed that refers to this coverage and 1 for the whole globe:

     caches: [name_of_the_cache_you_defined_in_your_mapproxy.yaml_for_the_detailed_area1]
       to: 19 #whatever level you want
     coverages: [coverage_of_detailed_area_1]

     caches: [name_of_the_cache_you_defined_in_your_mapproxy.yaml_for_the_entire_globe]
       to: 20 #whatever level you want

Then I run mapproxy-seed to pre cache these areas.


Benjamin Wragg

> From: mapproxy-bounces at lists.osgeo.org [mailto:mapproxy-bounces at lists.osgeo.org] On Behalf Of Benjamin Wragg
> Sent: Tuesday, August 07, 2012 1:24 AM
> To: mapproxy at lists.osgeo.org
> Subject: Re: [MapProxy] Dealing with a source with multiple resolutions in one layer
> Hi Paul,
> I think I had a similar setup problem the other day on this thread "Dealing with a source with multiple resolutions in one layer". I had 1 source of 19 levels that I wanted to cache at 8 levels all over and then greater levels over certain regions.
> Basically to get it to work I did the following:
> setup 1 source which had a grid that encompassed the whole earth e.g GLOBAL_MERCATOR with the maximum number of levels set, for me this was num_levels 19.
> setup 1 cache for the whole earth with a grid of GLOBAL_MERCATOR with num_levels 8
> setup a second cache for "detailed area 1" with a grid of GLOBAL_MERCATOR with num_levels 14.
> setup a third cache for "detailed area 2" with a grid of GLOBAL_MERCATOR with num_levels 1
> ....another cache for each area I want more than num_level 8.
> In my seed.yaml I have a coverage defined for each of the above areas and a seed that pre-caches each coverage.
> Does that make sense? Hope it helps..
> Regards,
> Benjamin Wragg
> On 06/08/2012, at 11:05 AM, Paul Norman <penorman at mac.com> wrote:
> I run mapproxy to cache several WMS layers and convert them to TMS. Normally
> I set up a layer, a cache using a grid with an appropriate num_levels for
> the resolution of the source and a WMS source.
> I've run into the case where one of the WMS layers is composed of multiple
> imagery shots at different resolution. I would like to cache up to level 21
> (zoom 20 in google-style numbering) for parts of it and to 19 in other
> parts.
> Is this possible? I can get polygons representing the extents of each part
> of the layer.
> If I use the same grid for the entire area then it could end up caching
> unnecessary data in the lower-resolution areas.
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapproxy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20120813/9fb1513f/attachment.html>

More information about the MapProxy mailing list