1

We have around 1800 1 arc-second SRTM tiles (Geotiff). How to effectively merge all the tiles into one single file ? We are thinking about splitting 100 files per folder and merge them together using QGIS merge. We don't have to create VRT as the client insists on a single tile.

My question is what are the parameters we have to tweak in QGIS Merge option ? There are few parameters in "Merge raster layers (through Processing tool)-Preferred data storage, Interpolation, Overlapping cells. Read somewhere, in case of SRTM tiles the first pixel line will overlap with the adjacent one. So do we have to use "First value in order of grid list" in case of overlapping cells.

Any kind of suggestions are welcomed.

Edit:

Finally i've managed to merge 2600 files. Divided the files into five folders and created VRT for each folder of 515 files. Then converted VRT to Geotiff using gdal_translate command in OSGEO shell (with DEFLATE, PREDICTOR = 2 parameters). Original file size was around 6.25GB. But the compressed output was 3.25GB each.

Then i again created VRT for those five files and did the same translation.

  • If you look at the DTED specification, you'll see that the 1-pixel overlap is required to be the same value in overlapping tiles, so this is a non-issue. I also seriously question the wisdom of placing all that data in a single raster - even 30x40 degree tiles are too large for most uses. I had to do large area modelling once, and structured tiles with overlap to reduce raster size. – Vince Mar 8 '15 at 17:44
  • It should go well by making a VRT from your originals and converting that to physical GeoTIFF file with gdal_translate. Use tiling and deflate compression, predictor=2 is probably good for you. – user30184 Mar 8 '15 at 17:55
  • The client insists on a single raster file rather than a VRT. So, no other way apart from mosaicing all those files – joseph_k Mar 9 '15 at 5:32
  • 2
    The VRT file should save you RAM and intermediate disk space, but you get a TIF in the end with the proposed way of @user30184. You could start off with just 10 files, and see how it works. – AndreJ Mar 9 '15 at 6:04
  • 1
    In my first commend I recommend to use options -co TILED=YES -co COMPRESS=DEFLATE -co PREDICTOR=2. This is loss-less compression. – user30184 Mar 10 '15 at 7:26
1

Use GDAL merge. You can access this function from command line or from within QGIS.

GDAL merge from QGIS

The above image is from QGIS 2.8.1. Click on the [...]-box to select the relevant images. The list of images in this example are not related to SRTM.

My own experience merging big TIFF images is that you will have less problems accessing it from command line linux. You can use OSGEO4W or GDAL binaries from gisinternals as well.

With 1800 images you are easily looking at a job which will take a couple of days. Since you are looking at a decent number of tiffs you should make sure that you have a lot of memory and a good processor on your processing computer.

It might help to split the job in several smaller ones. So working on chunks at 100 will make it easier for you. If, or even when, your process crashes you will not loose too much work at a time.

  • It does not necessarily have to be Linux commandline. OSGEO4W or GDAL binaries from gisinternals can be used as commandline tools as well. – AndreJ Mar 8 '15 at 18:43
  • @AndreJ Added this in my answer. Not too happy about using GDAL or other libraries from windwos. But that might just be me :-) – ragnvald Mar 8 '15 at 18:46
  • @ragnvald Thanks. But i've few doubts. Could you just tell me the system requirements like virtual memory, RAM, etc.. Total files are 2600 (60GB). Lets just say we've split it into 150 files each. Merging 150 files is not a big thing i guess. But, finally we'll have 12 files each of 5GB in size. So, mu question is will there be any problem in merging all those 12 files (5GB each) ? At this process, do we have to consider virtual memory, temp file etc.. ? Or is it possible to emulate the whole process in an external drive or something ? – joseph_k Mar 9 '15 at 5:45
  • @saravanaganesh18 the system requirements depend on your operating system, swap space, memory and more. I suggest you try this out using a couple of images first and see how it goes. Then you gradually scale it up. – ragnvald Mar 10 '15 at 8:27
  • Will try it and reply – joseph_k Mar 12 '15 at 3:17
1

overlapping pixels are not an issue with the SRTM tiles. They are duplicates so any choice is a good choice.

If you need all the tiles this can be done with gdal_buildvrt then gdal_translate. In addition to the good advices from @user30184 (-co TILED=YES -co COMPRESS=DEFLATE -co PREDICTOR=2) , make sure to also use

-co BIGTIFF=YES 

if your output file exceeds 4 Go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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