Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to generate map tiles using gdal2tiles for an area much larger than MapTiler can handle. However, my tile caches are not showing up on the maps. I checked gdal2tiles by running the same file through it and MapTiler - and the outputs come out differently. Here's my gdal2tiles command:

/usr/local/Cellar/gdal/1.9.0/bin/gdal2tiles.py -p mercator --s_srs 3857 -z 1-9 -v myFile.tiff

For instance, in the maptiler output, I get the file

9/85/197.png

While gdal gives me different files, like

9/85/313.png

The output should be identical, right? Is there something I'm missing? My projection on the original file is definitely correct. I have also tried gdal2tiles with 900913. I am running gdal2tiles on MacOS X Mountain Lion, gdal 1.9.0.

share|improve this question
1  
check out your profile whether mercator or geodetic. it looks like your first output is mercator and second is geodetic. –  Aragon Apr 12 '13 at 13:11
    
That's interesting.. but as you can see, I am calling gdal2tiles.py with the -p mercator argument, and mercator is also the default anyway. Do we think that that gdal2tiles could be broken in this reqard? –  deepwinter Apr 12 '13 at 17:01
    
possible duplicate of GDAL2Tiles: MapTiles from BSB/KAP are Switched –  Andre Joost Aug 27 '13 at 10:08
add comment

2 Answers

It's because gdal2tiles generates the tiles in TMS format. You need to enable it on your map or do a small calculation on the fly in order to display the tiles.

share|improve this answer
add comment

It is the difference between TMS and XYZ/WMTS addressing of the same mercator tile.

See the detailed description and mashup I made at:

http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/

GDAL2Tiles renders always TMS.

The scripts and equations for conversion of the flipped y-coordinate are mentioned in the MapTiler User Group on Google Groups.

If you render the map tiles with the new MapTiler (http://www.maptiler.com/) you can choose whether you want TMS or XYZ/WMTS addressing of the tiles. This option is available under the "Advanced options" button.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.