1

I am trying to stitch several hyperspectral tiles together using gdal. The raw files are in ENVI .bin/.hdr format.

I have used gdal to build a virtual raster for each scene, and then used gdal_merge to create the new combined file. I am using the OSGeo4W shell.

gdalbuildvrt -srcnodata 0 -input_file_list list.txt tiles.vrt

gdal_merge -o tile_mosaic.bin tiles.vrt

I have successfully output the files in .tif and .bil format, but I then need to convert the files, which takes a long time due to the file sizes (>200 GB per scene). I need to have it in .bin or .lan format to use with spectral python (SPy). When I try to merge to these formats, I get traceback messages stating:

File "C:\OSGEO4~1\bin\gdal_merge.py", line 611, in <module>
    sys.exit(main())
File "C:\OSGEO4~1\bin\gdal_merge.py", line 478, in main
    frmt = GetOutputDriverFor(out_file)
File "C:\OSGEO4~1\bin\gdal_merge.py", line 90, in GetOutputDriverFor
    raise Exception("Cannot guess driver for %s" % filename)
Exception: Cannot guess driver for tile_mosaic.lan

I'm fairly new to python and coding in general. Any help would be greatly appreciated!

bogatron
  • 18,639
  • 6
  • 53
  • 47
Josh Henry
  • 29
  • 2

1 Answers1

0

Try setting the output file format explicitly using the of tag. For example:

gdal_merge -of LAN -o tile_mosaic.lan tiles.vrt

For reference on the LAN raster driver in GDAL: https://gdal.org/drivers/raster/lan.html

Charles Parr
  • 573
  • 4
  • 16