<div dir="ltr">here are some bits of c# code which will help the OP out. <div><br></div><div>// you won't be able to use BoundingBox<T> - that's my class - but these are the "world extents" for a OSM map</div>
<div>_worldExtents = new BoundingBox<Coord>(left: -20037508.34, right: 20037508.34, top: 20037508.34, bottom: -20037508.34);<br></div><div><br></div><div>// compute resolutions for each zoom level</div><div><div>double[] resolutions = new double[_numZoomLevels];</div>
<div>            for (int z = 0; z < _numZoomLevels; z++)</div><div>            {</div><div>                resolutions[z] = (_worldExtents.Width / _tileSize) / Math.Pow(2.0, z);</div><div>            }</div></div><div>
<br></div><div><br></div><div>then you need to know how big a tile is in your chosen zoom level</div><div>private const int _tileSize = 256;<br></div><div>double _tileSizeMetres = _resolutions[_zoomLevel] * _tileSize;<br>
</div><div><br></div><div>// then you can work out the range of tiles you need</div><div><div>// e.MapExtents  is the region of interest (a rectangle in EPSG 3857)</div><div>            var tile_min_x = (int)Math.Floor((e.MapExtents.Left - _worldExtents.Left) / _tileSizeMetres);</div>
<div>            var tile_max_x = (int)Math.Floor((e.MapExtents.Right - _worldExtents.Left) / _tileSizeMetres);</div><div>            var tile_min_y = (int)Math.Floor((_worldExtents.Top - e.MapExtents.Top) / _tileSizeMetres);</div>
<div>            var tile_max_y = (int)Math.Floor((_worldExtents.Top - e.MapExtents.Bottom) / _tileSizeMetres);</div></div><div><br></div><div>// logically you can now do the following:-</div><div><br></div><div><div>for (int x = tile_min_x; x <= tile_max_x; x++)</div>
<div>            {</div><div>                for (int y = tile_min_y; y <= tile_max_y; y++)</div><div>                {</div></div><div>             // download tile x,y, _zoomLevel here</div><div><br></div><div>}</div>
<div>}</div><div><br></div><div><br></div><div>hope that helps. it's not finished code and won't compile, but if you regard it as pseudo-code it works correctly.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 15 July 2014 12:29, Devdatta Tengshe <span dir="ltr"><<a href="mailto:devdatta@tengshe.in" target="_blank">devdatta@tengshe.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Nakadale,<br>Based on your question on <a href="http://GIS.SE" target="_blank">GIS.SE</a>, and this one, I feel that you are misunderstanding the Slippy map tile structure. The structure of the Tile sets is fixed. <br>
<ul>
<li>For a particular zoom level, the x & y of the tiles goes from 0 to (2^zoom)-1.</li></ul><ul><li>There are only integer zoomlevels (from 0 to 19...), and you can't get zoomlevles in decimal values.</li></ul><br>

It is important to note that the formulas given on the linked page give the coordinates for the NW-corner of the square.<br><br><br>If you want to download tiles, have a look at this gist which I've successfully used in the past: <a href="https://gist.github.com/devdattaT/dd218d1ecdf6100bcf15" target="_blank">https://gist.github.com/devdattaT/dd218d1ecdf6100bcf15</a><br>

<br>To successfully download tiles, you need to find which tiles intersect your study area, and only download those. To find which tiles which intersect your study area, you can use the bounding box of your polygon as the first check. Find out which tiles contain your geometry by  checking for tiles that contain the top-left & Bottom-right of your bounding box. Your Geometry will be guaranteed to be within these. After this, as a secondary filter, you can check if your geometry intersects each tile before downloading it, if required.<br>

<br>If this doesn't answer your question, you need to explain why you are interested with partial zoom-levels and resolution.<br><br>Regards,<br>Devdatta Tengshe<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">
On Mon, Jul 14, 2014 at 12:48 PM, Nakadale <span dir="ltr"><<a href="mailto:lester_sherwin@hotmail.com" target="_blank">lester_sherwin@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello! Can anyone help me with my problem? I'm trying to do a map tile<br>
downloader for my map app. problem is when I try to implement the formula<br>
from this site  Slippy Map Tilenames<br>
<<a href="http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels" target="_blank">http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels</a>>   the<br>
tiles X and Y number that i get are off. Upon further trying to make it work<br>
is for me to get the Zoom Level with decimal numbers. I wonder if there<br>
maybe other way to get the correct tiles aside from using Slippy Map<br>
Tilenames or if there can be a way to calculate the Zoom level with<br>
decimals?<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Create-a-Map-Tile-Downloader-tp5150857.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Create-a-Map-Tile-Downloader-tp5150857.html</a><br>


Sent from the OpenLayers Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.osgeo.org" target="_blank">Dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br></blockquote></div><br></div>