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 wanted to merge around 20 dem tiffs each around 100MB, and I used gdalwarp (I know about virtual file option):

gdalwarp $(list_of_tiffs) merged.tiff

However this command took very long time, and after some 15min it was processing 5th image from set. I terminate it.

I then found that script can be used also for mosaicing, and tried it: $(list_of_tiffs)

which completed in less then 3min.

As I expected that both commands would produce same result, I wonder what's the difference between the two, as to why gdalwarp takes so much time if result is same?

share|improve this question
up vote 10 down vote accepted

While I don't know why GDAL provides this overlap in functionality, be sure to set the cache for gdalwarp to make it really fast:

# assuming 3G of cache here:
gdalwarp --config GDAL_CACHEMAX 3000 -wm 3000 $(list_of_tiffs) merged.tiff

Be sure to not define more cache than having RAM on the machine.

share|improve this answer
Had no idea about this tuning switch, which indeed speeds up the process. For reference 3000 is 3GB (more info I have NumPy build with MKL in my system Python, but still gdalwarp must be doing something more, as NumPy can't be faster then C implementation, although can reach it. – zetah Dec 27 '12 at 4:30

I just happened to come across this question and a potential answer when looking for something else. uses nearest neighbor resampling. If you want control over the resampling used, you should use gdalwarp instead.


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.