I have this information:For Ogun State Nigeria from http://www.maphill.com/nigeria/ogun/
South
6° 18' 6" N
North
7° 59' 23" N
West
2° 40' 6" E
East
4° 34' 47" E
I have map tiles @ different zoom levels 10,11,12,13,14,etc for the whole of Nigeria stored as z,x,y,tile_data
Please how can I identify just the tiles within the given bounds at each zoom level
Best Answer
First You can check this page as a guide to you Tile Calculator BETA
But you need to know that you will create a server side page that will handle the requested Bounding box (BBOX) and the required zoom level and will response with Tiles (X,Y) coordinates as the Slippy map tilenames and as this page Tiles à la Google Maps: Coordinates, Tile Bounds and Projection.
As an example i made a php sample code to get the starting Tile(X,Y) and the last Tile(X,Y) from both of them you can get total number of the required tiles in each row and column and also you can get the total number of tiles from the simple formula (#Rows x #Columns).
If you use the sample url parameters:
The output will be:
You can test the code online in phpFiddle.org
So if you need to get all the required tiles name you need to loop through the tiles using Tile(X,Y) and change the X and Y values with the (MinTileX to MaxTileX) and from (MinTileY to MaxTileY).
Finally you will collect all the required tiles Urls.