1

I have DEMs in a folder like this enter image description here

If I run gdal_merge -o out.tif *.hgt, it says

ERROR 4: `/*.hgt' does not exist in the file system, and is not recognized as a supported dataset name.

A similar thread asked this but the solution was to make a virtual file first and convert it to a .tif file. Merging all tiles from one directory using GDAL

Another similar thread https://trac.osgeo.org/gdal/ticket/2783#no1

BallpenMan
  • 1,217
  • 8
  • 19
  • 1
    You must make a input file list (file1.tif file2.tif file3.tif...). You can select your tools for that but there is a solution for building the file list with Python in https://gis.stackexchange.com/questions/230553/merging-all-tiles-from-one-directory-using-gdal. However, I would also recommend to use gdalbuildvrt. – user30184 Nov 09 '21 at 14:38
  • Yes, typing the files manually is the workaround. But I'd like to use a wildcard since there might be a case that there are just too many raster files for me to type. I added in my post a similar thread which says the GDAL Python tools do not support wildcards. – BallpenMan Nov 09 '21 at 14:44
  • I did not say that you must make the list manually, use your favorite scripting language instead. But why not to use gdalbuildvrt output.vrt *.hgt instead? All 13 years old issues are not valid any more but the one that you found may be. – user30184 Nov 09 '21 at 14:47

0 Answers0