<div dir="ltr">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<br><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div>grids:<br> moscow:<br> base: GLOBAL_WEBMERCATOR<br> bbox: "37.3352,55.5496,37.893,55.9184"<br> bbox_srs: EPSG:4326<br> num_levels: 19<br><br>Result:<br><br>$ mapproxy-util grids --grid moscow --mapproxy-conf mapproxy.yaml<br><br>moscow:<br> Configuration:<br> base: 'GLOBAL_WEBMERCATOR'<br> bbox: '37.3352,55.5496,37.893,55.9184'<br> bbox_srs: 'EPSG:4326'<br> num_levels: 19<br> origin*: 'ul'<br> tile_size*: [256, 256]<br> Levels: Resolutions, # x * y = total tiles<br> 00: 284.8329187718773, # 1 * 1 = 1<br> 01: 142.41645938593865, # 2 * 2 = 4<br> 02: 71.20822969296933, # 4 * 4 = 16<br> 03: 35.60411484648466, # 7 * 8 = 56<br> 04: 17.80205742324233, # 14 * 16 = 224<br> 05: 8.901028711621166, # 28 * 32 = 896<br> 06: 4.450514355810583, # 55 * 64 = 3.520K<br> 07: 2.2252571779052914, # 109 * 128 = 13.952K<br> 08: 1.1126285889526457, # 218 * 256 = 55.808K<br> 09: 0.5563142944763229, # 436 * 512 = 223.232K<br> 10: 0.27815714723816143, # 873 * 1024 = 893.952K<br> 11: 0.13907857361908071, # 1745 * 2048 = 3.574M<br> 12: 0.06953928680954036, # 3489 * 4096 = 14.291M<br> 13: 0.03476964340477018, # 6977 * 8192 = 57.156M<br> 14: 0.01738482170238509, # 13953 * 16384 = 228.606M<br> 15: 0.008692410851192545, # 27905 * 32768 = 914.391M<br> 16: 0.004346205425596272, # 55809 * 65536 = 3.657G<br> 17: 0.002173102712798136, # 111617 * 131072 = 14.630G<br> 18: 0.001086551356399068, # 223234 * 262144 = 58.519G<div><br></div><div>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.</div><div><br></div><div>For correct calculation I have to manuall specify min_res:</div><div><br></div><div><div> moscow:</div><div> base: GLOBAL_WEBMERCATOR</div><div> min_res: 156543.03</div><div> bbox: "37.3352,55.5496,37.893,55.9184"</div><div> bbox_srs: EPSG:4326</div><div> num_levels: 19</div></div><div><br></div><div><div>$ mapproxy-util grids --grid moscow --mapproxy-conf mapproxy.yaml</div><div>moscow:</div><div> Configuration:</div><div> base: 'GLOBAL_WEBMERCATOR'</div><div> bbox: '37.3352,55.5496,37.893,55.9184'</div><div> bbox_srs: 'EPSG:4326'</div><div> min_res: 156543.03</div><div> num_levels: 19</div><div> origin*: 'ul'</div><div> tile_size*: [256, 256]</div><div> Levels: Resolutions, # x * y = total tiles</div><div> 00: 156543.03, # 1 * 1 = 1</div><div> 01: 78271.515, # 1 * 1 = 1</div><div> 02: 39135.7575, # 1 * 1 = 1</div><div> 03: 19567.87875, # 1 * 1 = 1</div><div> 04: 9783.939375, # 1 * 1 = 1</div><div> 05: 4891.9696875, # 1 * 1 = 1</div><div> 06: 2445.98484375, # 1 * 1 = 1</div><div> 07: 1222.992421875, # 1 * 1 = 1</div><div> 08: 611.4962109375, # 1 * 1 = 1</div><div> 09: 305.74810546875, # 1 * 1 = 1</div><div> 10: 152.874052734375, # 2 * 2 = 4</div><div> 11: 76.4370263671875, # 4 * 4 = 16</div><div> 12: 38.21851318359375, # 7 * 8 = 56</div><div> 13: 19.109256591796875, # 13 * 15 = 195</div><div> 14: 9.554628295898437, # 26 * 30 = 780</div><div> 15: 4.777314147949219, # 51 * 60 = 3.060K</div><div> 16: 2.3886570739746094, # 102 * 120 = 12.240K</div><div> 17: 1.1943285369873047, # 204 * 239 = 48.756K</div><div> 18: 0.5971642684936523, # 407 * 477 = 194.139K</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 24, 2016 at 8:49 PM, Oliver Tonnhofer <span dir="ltr"><<a href="mailto:olt@omniscale.de" target="_blank">olt@omniscale.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
> On 24.03.2016, at 15:26, Denis Rykov <<a href="mailto:rykovd@gmail.com">rykovd@gmail.com</a>> wrote:<br>
><br>
> 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.<br>
<br>
</span>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 <a href="https://github.com/mapproxy/mapproxy/blob/master/mapproxy/grid.py#L67" rel="noreferrer" target="_blank">https://github.com/mapproxy/mapproxy/blob/master/mapproxy/grid.py#L67</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Regards,<br>
Oliver<br>
<br>
--<br>
Oliver Tonnhofer | Omniscale GmbH & Co KG | <a href="http://omniscale.com" rel="noreferrer" target="_blank">http://omniscale.com</a><br>
OpenStreetMap WMS and tile services | <a href="http://maps.omniscale.com" rel="noreferrer" target="_blank">http://maps.omniscale.com</a><br>
<br>
</div></div></blockquote></div><br></div>