[MapProxy] proxy by mask?

Oliver Tonnhofer olt at omniscale.de
Sun Aug 22 11:46:39 EDT 2010

On 21.08.2010, at 19:37, Russ Nelson wrote:
> Hi.  I'm trying to edit OSM in New York State.  Unfortunately, the
> aerial imagery is split up into 90 different layers.  I'd like to use
> code similar to combined_layer as described here:
> http://mapproxy.org/docs/latest/configuration_examples.html#merge-multiple-layers

90 different layers or 90 different WMS servers? If it is the former, than you can just add them all to the layers parameter:

    title: NY
  - type: cache_wms
        url: http://example.org/service?
        layers: l1,l2,l3,l4,l5

> I'm trying to determine how mapproxy is configured to fetch multiple
> layers.  Is it the simple existance of multiple sources in
> config.yaml?  Or is it "transparent: true"?

Both. If a layer has multiple sources, then they all will be fetched. Additionally, all but the bottom layer need to be transparent. 

> Can I get a few hints about how things are implemented?
>  o How are the pixmaps merged into a single image?  It looks like
>    wms/layer.py:VLayer returns multiple images every time you
>    call render.

The WMS layers render methods can return multiple images, they are merged within the WMS server. However, multiple sources for a single cache are combined in mapproxy.wms.cache:WMSTileSource. 

>  o How are bboxes handled?  Are the bboxes for a layer fetched,
>    and requests sent to the WMS server only if the request is
>    inside its bbox?  If so, I can't find the code which does that.
>    looked in wms/*, core/layer.py and core/image.py

That's all in mapproxy.core.grid, see get_affected_tiles for example.

> Also, here's my design for the configuration. [...]

If you want to develop some new feature/extension, I strongly suggest you to build it on MapProxy 0.9 and not 0.8.x. Both the configuration and parts of the request/cache/layer-stuff changed.

The 0.9 development is in the default branch of MapProxy: http://bitbucket.org/olt/mapproxy


Oliver Tonnhofer <olt at omniscale.de>
Omniscale - Dominik Helle, Oliver Tonnhofer GbR
Nadorster Str. 60, 26123 Oldenburg
Tel: +49(0)441/9392774-2 (Fax: 9)

More information about the MapProxy mailing list