[MapProxy] min_res in default grids

Denis Rykov rykovd at gmail.com
Thu Mar 24 08:11:30 PDT 2016


My use case: I need to calculate number of tiles for particular city in
GLOBAL_WEBMERCATOR grid which I will display over OSM basemap. Grid config

grids:
    moscow:
        base: GLOBAL_WEBMERCATOR
        bbox: "37.3352,55.5496,37.893,55.9184"
        bbox_srs: EPSG:4326
        num_levels: 19

Result:

$ mapproxy-util grids --grid moscow --mapproxy-conf mapproxy.yaml

moscow:
    Configuration:
        base: 'GLOBAL_WEBMERCATOR'
        bbox: '37.3352,55.5496,37.893,55.9184'
        bbox_srs: 'EPSG:4326'
        num_levels: 19
        origin*: 'ul'
        tile_size*: [256, 256]
    Levels: Resolutions, # x * y = total tiles
        00:  284.8329187718773,    #      1 * 1      =        1
        01:  142.41645938593865,   #      2 * 2      =        4
        02:  71.20822969296933,    #      4 * 4      =       16
        03:  35.60411484648466,    #      7 * 8      =       56
        04:  17.80205742324233,    #     14 * 16     =      224
        05:  8.901028711621166,    #     28 * 32     =      896
        06:  4.450514355810583,    #     55 * 64     =   3.520K
        07:  2.2252571779052914,   #    109 * 128    =  13.952K
        08:  1.1126285889526457,   #    218 * 256    =  55.808K
        09:  0.5563142944763229,   #    436 * 512    = 223.232K
        10:  0.27815714723816143,  #    873 * 1024   = 893.952K
        11:  0.13907857361908071,  #   1745 * 2048   =   3.574M
        12:  0.06953928680954036,  #   3489 * 4096   =  14.291M
        13:  0.03476964340477018,  #   6977 * 8192   =  57.156M
        14:  0.01738482170238509,  #  13953 * 16384  = 228.606M
        15:  0.008692410851192545, #  27905 * 32768  = 914.391M
        16:  0.004346205425596272, #  55809 * 65536  =   3.657G
        17:  0.002173102712798136, # 111617 * 131072 =  14.630G
        18:  0.001086551356399068, # 223234 * 262144 =  58.519G

As you can see in this case min_res is calculated from bbox. But I have
expected that min_res will be 156543.03, becaue I use 'GLOBAL_WEBMERCATOR'
as base.

For correct calculation I have to manuall specify min_res:

    moscow:
        base: GLOBAL_WEBMERCATOR
        min_res: 156543.03
        bbox: "37.3352,55.5496,37.893,55.9184"
        bbox_srs: EPSG:4326
        num_levels: 19

$ mapproxy-util grids --grid moscow --mapproxy-conf mapproxy.yaml
moscow:
    Configuration:
        base: 'GLOBAL_WEBMERCATOR'
        bbox: '37.3352,55.5496,37.893,55.9184'
        bbox_srs: 'EPSG:4326'
        min_res: 156543.03
        num_levels: 19
        origin*: 'ul'
        tile_size*: [256, 256]
    Levels: Resolutions, # x * y = total tiles
        00:  156543.03,          #      1 * 1      =        1
        01:  78271.515,          #      1 * 1      =        1
        02:  39135.7575,         #      1 * 1      =        1
        03:  19567.87875,        #      1 * 1      =        1
        04:  9783.939375,        #      1 * 1      =        1
        05:  4891.9696875,       #      1 * 1      =        1
        06:  2445.98484375,      #      1 * 1      =        1
        07:  1222.992421875,     #      1 * 1      =        1
        08:  611.4962109375,     #      1 * 1      =        1
        09:  305.74810546875,    #      1 * 1      =        1
        10:  152.874052734375,   #      2 * 2      =        4
        11:  76.4370263671875,   #      4 * 4      =       16
        12:  38.21851318359375,  #      7 * 8      =       56
        13:  19.109256591796875, #     13 * 15     =      195
        14:  9.554628295898437,  #     26 * 30     =      780
        15:  4.777314147949219,  #     51 * 60     =   3.060K
        16:  2.3886570739746094, #    102 * 120    =  12.240K
        17:  1.1943285369873047, #    204 * 239    =  48.756K
        18:  0.5971642684936523, #    407 * 477    = 194.139K



On Thu, Mar 24, 2016 at 8:49 PM, Oliver Tonnhofer <olt at omniscale.de> wrote:

> Hi,
>
> > On 24.03.2016, at 15:26, Denis Rykov <rykovd at gmail.com> wrote:
> >
> > It make sense. But if grid has GLOBAL_* name it is expected that for
> calculation of min_res - global (-180,-90,180,90) bbox will be used.
> Otherwise why is it global.
>
> I don't understand your question. MapProxy defines default bounding boxes
> for EPSG:4328 and EPSG:3857. That's how it calculates the min_res. Maybe
> this makes it more clear? See
> https://github.com/mapproxy/mapproxy/blob/master/mapproxy/grid.py#L67
>
>
> Regards,
> Oliver
>
> --
> Oliver Tonnhofer  | Omniscale GmbH & Co KG  | http://omniscale.com
> OpenStreetMap WMS and tile services         | http://maps.omniscale.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20160324/e911ecc2/attachment.html>


More information about the MapProxy mailing list