[MapProxy] MapProxy asks for wms tiles that are too large

Anne Blankert anne.blankert at geodan.nl
Sun Sep 26 20:25:09 EDT 2010


 Op 27-9-2010 1:40, Anne Blankert schreef:
> Hello list,
>
> Is this a bug or a feature?
>
> According to the documentation, MapProxy requests more than 1 tile at a
> time from the remote WMS server. This is defined in proxy.yaml.
>
> The default configuration seems to be:
>
> # request x*y tiles in one step
> #     meta_size: [4, 4]
> #     # add a buffer on all sides (in pixel) when requesting
> #     # new images
> #     meta_buffer: 80
>
> So when you define the following for your layer in services.yaml:
> # use a tile size of:
>             tile_size: [256, 256]
>
> This should result in sending wms request for images of
> (4 x 256 + 2 x 80) x (4 x 256 + 2 x 80) = 1184 x 1184 pixels.
>
> For some reason, I see that sometimes MapProxy sends requests for other
> dimensions:
> 1184 x 2081 pixels
> 1184 x 2284 pixels
> 1184 x 4179 pixels
> 1184 x 2478 pixels
>
> This happens especially when zooming out. Maybe something to do with the
> nul meridian?
>
> In my case, the wms server complains about images being too large if
> dimensions go beyond 2048x2048. This results in a WMS exception, which
> MapProxy does not cache (should not be). This results in slower
> responses and extra traffic to the WMS server. To me, it seems this
> behaviour should not happen?
>
> Documentation remark:
> At http://mapproxy.org/docs/latest/configuration.html#services-yaml
> under "meta_size"
> it says: "A meta_size of [4, 4] will request 64 tiles in one pass". If I
> understand correctly, this should read:
> "A meta_size of [4, 4] will request 16 tiles in one pass"
>
> Regards,
>
> Anne
>
I think I've figured out what might be happening:
I am requesting tiles from MapProxy using the sphericalmercator
projection (epsg:900913). My MapProxy is configured to request WGS84
(epgs:4326) tiles from the WMS server. So what probably happens, is that
the needed source pixel dimensions for WGS84 are much larger than the
requested target dimensions for SphericalMercator. When zooming out, my
client starts requesting tiles for more northerly regions and the more
northerly you go, the bigger the horizontal pixel difference between
WGS84 and SphericalMercator. If the source dimensions happen to go
beyond the maximum dimension of the WMS server, a WMS server exception
will occur.

This means that when using reprojection, the requested WMS tiles may
become unexpectedly large.
So maybe users should set their meta_size to less than [4, 4]. According
to the documentation this is a MapProxy global setting? Could/Should
there be an override for meta_size at the layer level or an other
solution to problem of some wms requests requesting image that are too
large?

Anne





More information about the MapProxy mailing list