I am working on an app that needs to create tiles (jpeg) from a given raster dataset. My initial inclination was to use gdal2tiles.py, but its performance seems like it could be improved.

That leads me to ask the following question: What would be the fastest way to cut a 'tiled image' from a raster dataset using GDAL? And by 'tiled image', I mean just a simple jpeg or png.

In my prototype, I use the MapServer C# MapScript bindings to do the job. That is, I create a map object, loop through all the tile bounds I need to cut, set the map objects extent, and then save the resulting image. The performance of this approach is significantly better than that of gdal2tiles.py, but I am wondering if I use GDAL directly if I can't make it even faster. Can anyone suggest a similar workflow with GDAL methods?

EDIT: After some more research today, I found the answer right in front of me. If you have downloaded FWTools, the csharp\apps folders contains a number of classes to demonstrate the C# GDAL bindings. In my case the GDALRead.cs and GDALReadDirect.cs were what I was looking for.

  • 3
    @vadp, @markusn, @mapperz & everyone else - please be descriptive. In addition to the link a sentence or two as to why you think this tool is worth looking at and what differentiates from the others will be helpful. We want the answer to be useful in the future as well as right away. Sooner or later link-rot strikes and if all we have is the url it's hard to find where the project incarnated next. Commented Feb 11, 2011 at 0:25
  • 5
    Hi user890, could you post your final solution to the question and mark it as closed? in this case, it sounds like using the language specific bindings gave you the performance you need.
    – scw
    Commented Feb 27, 2011 at 6:26
  • I can't add a comment, to my own post :( But gdal_tiler.py also supports multiprocessing, but in a very brute force way: it simply processes 'n' sources at once. Nevertheless it makes some positive effect :)
    – Vadim
    Commented Aug 4, 2014 at 17:08

7 Answers 7


Someone has spent the time to make gdal2tiles.py use multiple processors: parallel gdal

I have used this and it does seem to work. It successfully utilizes all 4 cores to 100% and cuts the total time to create the tiles down to 1/4th of the original time.


Did you try this? http://www.klokan.cz/projects/gdal2tiles/

  • Thanks for the comment, this is basically a GUI for the gdal2tiles.py script, kind of slow.
    – user890
    Commented Jan 14, 2011 at 2:48

In my company we wrote custom python scripts, using gdal_warp (it was before we knew gdal2tiles existed). It was faster then g2t, esspecialy when we rewrote it to run on many cores (using python threadpool). Also it produced higher quality tiles (lanczos interpolation on g2t seems to work bad, in gdal_warp resulting tiles were astonishing).

It needs a little bit effort to write the scripts, you need to manualy calculate resulting bounding boxes, set up some options for projections, etc.




works well and it can be used for cutting up images

  • Thanks for the tip. I am looking to do this all programatically, it doesn't look thats possible with MapCruncher?
    – user890
    Commented Jan 13, 2011 at 16:17

Another option is using TileCache (WMS-C). Although I have never used gdal2tiles, I would not expect that TileCache would bring improved performance.

Anyway, the following strategies can speed up tiling:

  • Metatiling, if using TileCache (I wonder if gdal2tiles has a similar feature).
  • In case the raster data is a big ortophoto, use a format like ECW. Since this format features partial decompression, by using this format you can get a significant performance gain.

gdal_tiler.py script from http://code.google.com/p/tilers-tools could be a useful option.

Usually it shows very good performance in comparison with gdal2tiles.py and it should work with any GDAL source (dataset), in particular, it doesn't require a conversion of a source dataset to RGB.


Gdal2tiles_parallel https://gitlab.com/GitLabRGI/erdc/geopackage-python If geopackage or MBTILES then no python is needed that's done natively with gdal_translate.EXE. you need to also run gdaladdo to add more than one zoom level. i also use qtiles/qmetatiles for qgis desktop. Still nothing can compete with maptiler pro commercial software. If you need folder of tiles just convert MBTILES to TMS OR XYZ with mbUtil python


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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