Conversion of ENVI binary files to tiff

823 Views Asked by At

I have a challenge in converting a batch of ENVI binary files(BSQ) temperature data(gotten from SAFARI 2000 AVHRR-Derived LST) to geotiff files. How can i read them and convert it to geotiff?
An example of one such file is 'afn_011-011_96.n14-LST_UL'

1

There are 1 best solutions below

0
On

You would need to provide a proper sample dataset and the corresponding meta-data that tells you the image dimensions in pixels, the data type and so on, but in principle you can do it with ImageMagick which is included in most Linux distros and is available for macOS and Windows.

So, using the dataset here sample dataset and knowing the data is unsigned 8 bit and 360x180 pixels, you would run this command in Terminal (or Command Prompt if on Windows):

convert -size 360x180 -depth 8 gray:gl-latlong-1deg-landcover.bsq -auto-level result.tif

If your data is multi-band band-sequential, you may have to use:

convert -size 360x180 -depth 8 -interlace plane rgb:gl-latlong-1deg-landcover.bsq -auto-level result.tif

Or, if you cannot get that to work, you may need to extract each band separately using a byte offset and then combine them afterwards, something like:

convert -size 360x180        -depth 8 gray:image.bsq -auto-level red.tif
convert -size 360x180+64800  -depth 8 gray:image.bsq -auto-level green.tif
convert -size 360x180+129600 -depth 8 gray:image.bsq -auto-level blue.tif
convert red.tif green.tif blue.tif -combine RGB.tif

Note that if you install ImageMagick v7 or newer, the above commands change to:

magick -size ...

rather than:

convert -size ...

Keywords: ImageMagick, command-line, command line, image, image processing, satellite, ENVI, band-sequential, planar, imagery, AVHRR, convert