Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on an app that needs to create tiles (jpeg) from a given raster dataset. My initial inclination was to use, 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 proto-type, 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, but I am wondering if I use GDAL directly if I cant 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.

share|improve this question
@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. – matt wilkie Feb 11 '11 at 0:25
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 Feb 27 '11 at 6:26
I can't add a comment, to my own post :( But also supports multiprocessing, but in a very brute force way: it simply processes 'n' sources at once. Nevertheless it makes some positive effect :) – vadp Aug 4 '14 at 17:08

Someone has spent the time to make 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.

share|improve this answer

Did you try this?

share|improve this answer
Thanks for the comment, this is basically a GUI for the script, kind of slow. – user890 Jan 14 '11 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.

share|improve this answer


works well and it can be used for cutting up images

share|improve this answer
Thanks for the tip. I am looking to do this all programatically, it doesn't look thats possible with MapCruncher? – user890 Jan 13 '11 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.
share|improve this answer script from could be a useful option.

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

share|improve this answer

Your Answer


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.