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 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 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 gdal2tiles.py, 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
2  
@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
4  
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
add comment

6 Answers 6

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

share|improve this answer
    
Thanks for the comment, this is basically a GUI for the gdal2tiles.py script, kind of slow. –  user890 Jan 14 '11 at 2:48
add comment

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.

share|improve this answer
add comment

MapCruncher

http://research.microsoft.com/en-us/um/redmond/projects/mapcruncher/

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
add comment

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
add comment

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
add comment

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.

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.