[MapProxy] MapProxy Seeding in a certain scale

Oliver Tonnhofer olt at omniscale.de
Wed Aug 7 00:32:06 PDT 2013




On 06.08.2013, at 18:08, Andras Szekeres wrote:
> I`m still wondering how to do it, so some more information:
> When I do 
> mapproxy-util grids --grid grid4258 --mapproxy-conf  mapproxy.yaml
> 
> I get:
>  Levels: Resolutions, # x * y = total tiles
>         00:  0.12448515433241368,    #      1 * 1      =        1
>         01:  0.06224257716620684,    #      2 * 1      =        2
>         02:  0.03112128858310342,    #      4 * 2      =        8
>         03:  0.01556064429155171,    #      8 * 4      =       32
>         04:  0.007780322145775855,   #     16 * 8      =      128
>         05:  0.0038901610728879275,  #     32 * 16     =      512
>         06:  0.0019450805364439638,  #     64 * 32     =   2.048K
>         07:  0.0009725402682219819,  #    128 * 64     =   8.192K
>         08:  0.00048627013411099094, #    256 * 128    =  32.768K
>         09:  0.00024313506705549547, #    512 * 255    = 130.560K
>         10:  0.00012156753352774773, #   1024 * 509    = 521.216K
>         11:  6.078376676387387e-05,  #   2048 * 1017   =   2.083M
>         12:  3.0391883381936934e-05, #   4096 * 2033   =   8.327M
>         13:  1.5195941690968467e-05, #   8192 * 4066   =  33.309M
>         14:  7.5979708454842334e-06, #  16384 * 8132   = 133.235M
>         15:  3.7989854227421167e-06, #  32768 * 16263  = 532.906M
>         16:  1.8994927113710584e-06, #  65536 * 32525  =   2.132G
>         17:  9.497463556855292e-07,  # 131072 * 65049  =   8.526G
>         18:  4.748731778427646e-07,  # 262144 * 130097 =  34.104G
>         19:  2.374365889213823e-07,  # 524288 * 260193 = 136.416G


It's still not clear what your actual goal is. Do you want to use this grid and preseed scales 1:30000 and 1:20000?
This grid doesn't have any zoom levels that are exactly at these scales. You could seed the nearest levels to these scales, but MapProxy will need to rescale the images to match the exact scale. 
If the quality is not sufficient, then you will need to create a custom grid that contains levels with these scales.

BTW: Level 11 is around 1:19000 at 72dpi, (but 1:25000 at 96dpi)
% mapproxy-util scales --unit d --dpi 72 --res-to-scale 6.078376676387387e-05
    19180.3973801146 #  0           0.00006078

> And for the scale:
> 
> res: [
>     # res level scale @90.7 DPI
>       8.4000000000, # 0 30000.00000000
>       5.6000000000, # 1 20000.00000000
>      ]

You need to use the `--unit d` option when you are calculating with degrees. Otherwise you will get the resolution in meters.
You also need to check the --dpi option. E.g. OpenLayers uses 72dpi for scale calculations. (That means when OpenLayers shows you a map at scale 1:30000, it will make WMS requests with a resolution of 10.58m/px and not 8.4m/px. 


> As a grid I defined in my mapproxy.yaml:
> 
> grids:
>  hungary_4258:
>      srs: 'EPSG:4258'
>      bbox: [15.996,45.652,22.939,48.647]
>      bbox_srs: 'EPSG:4326'
>      res: [
>     # res level scale @90.7 DPI
>       8.4000000000, # 0 30000.00000000
>       5.6000000000, # 1 20000.00000000
>      ]
> 
> My seed.yaml:
> 
> seeds:
>   seedjob:
>     caches: [hungary_cache]
>     grids: [epsg4258]

You are not using your custom grid here.

>     coverages: [hungary]
>     levels:
>       to: 19
> 
> coverages:
>   hungary:
>     bbox: [15.996,45.652,22.939,48.647]
>     bbox_srs: "EPSG:4326"
> 
> I don`t get the link between scale and level.From where do I know which level is which scale? Which level would be 1:20 000? 

Scale is always dependent on the output device (100dpi LCD? 200dpi Smartphone? 300dpi plot?). Convert the scale with your expected dpi value to a resolution and use this value.


Regards,
Oliver

-- 
Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.com
http://mapproxy.org | https://github.com/olt    | @oltonn









More information about the MapProxy mailing list