Geoscience Reference
In-Depth Information
for file in *.tif; do gdal_translate -mo
"TIFFTAG_DOCUMENTNAME=$(pwd)/$file" $file $(basename
$file .tif)_annotated.tif; done
The default format in which GDAL writes GeoTIFF bands is BIP (see also
Sect. 3.5 ) . Although this encoding is supported by most image processing software,
data access is faster for band (BAND) and line (BIL) interleaved image files. The
encoding can be set using the creation option -co . The following two commands
convert a Landsat 8 image. The first command creates a Landsat 8 image as BIP,
without tiling and compression. The second command uses tiling with a BAND
encoding.
gdal_translate -co INTERLEAVE=PIXEL -co TILED=NO -co
COMPRESS=NONE LC82070232013160LGN00.tif
landsat_stripped_pixel.tif
gdal_translate -co INTERLEAVE=BAND -co TILED=YES -co
BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co COMPRESS=NONE
LC82070232013160LGN00.tif landsat_tiled_band.tif
With gdalinfo , we can check the encoding and block sizes of the created bands:
gdalinfo landsat_stripped_pixel.tif
...
INTERLEAVE=PIXEL
...
Band 1 Block=1905x1 Type=UInt16, ColorInterp=Gray
Band 2 Block=1905x1 Type=UInt16, ColorInterp=Undefined
Band 3 Block=1905x1 Type=UInt16, ColorInterp=Undefined
...
gdalinfo landsat_tiled_band.tif
...
INTERLEAVE=BAND
...
Band 1 Block=256x256 Type=UInt16, ColorInterp=Gray
Band 2 Block=256x256 Type=UInt16, ColorInterp=Undefined
Band 3 Block=256x256 Type=UInt16, ColorInterp=Undefined
...
Encoding in BIP can be very inefficient when images are read by band (or by
band per line). The problem with BIP is that the hard disk can not read a contiguous
sequence of bytes. As an example, we read through all pixels of all spectral bands of
 
 
Search WWH ::




Custom Search