Changes between Initial Version and Version 1 of Processing/GDALVRTMosaic

Apr 8, 2015 4:18:33 PM (6 years ago)

Added mosaic creation page


  • Processing/GDALVRTMosaic

    v1 v1  
     1The steps below describe an easy way of creating mosaics from mapped hyperspectral files, making use of the command line GDAL utilities. They can be installed on Windows through [ OSGeo4W], and are available on Linux through the package manager (e.g., yum, apt-get).
     3The initial mosaic is a 'virtual raster', which comprises a text file with links to other files containing the data. It is created using the [ gdalbuildvrt] command, available with GDAL and also in QGIS through the Raster -> Miscellaneous menu.
     6gdalbuildvrt -srcnodata 0 f216_mosaic.vrt /path/to/file/f216073b_mapped_osng.bil /path/to/file/f216083b_mapped_osng.bil
     9The above command creates a virtual raster 'f216_mosaic.vrt' from two bil files, setting the no-data value to 0. The full path to each BIL file is passed in so they are stored in the VRT (useful if the VRT file is moved). You can also create a VRT from all '.bil' files using:
     12gdalbuildvrt -srcnodata 0 f216_mosaic.vrt /path/to/file/*.bil
     15The VRT file can be used as any other file in programs which use GDAL (e.g., QGIS, ArcGIS, TuiView). However, for displaying it is often more convenient to create band / spatial subsets using the [ gdal_translate], also available through QGIS under Raster -> Conversion -> Translate.
     16 command. For example to create a three band subset using bands 38, 25 and 12 use:
     19gdal_translate -of GTiff -b 38 -b 25 -b 12 f216_mosaic.vrt f216_mosaic_bandsubset.tif
     22Standard GeoTiff's aren't compressed so areas outside the flightlines, which have no data, will take up as much space as pixels with data. You can reduce the file size by using compression. You can tell gdal_translate to create a compressed GeoTiff by passing in a creation option flag for example:
     25gdal_translate -of GTiff -co "COMPRESS=LZW" -b 38 -b 25 -b 12 f216_mosaic.vrt f216_mosaic_bandsubset.tif
     28Note, not all programs support compressed GeoTiffs.
     30To make the mosaic faster to display you can create overviews using the [ gdaladdo] command:
     32gdaladdo f216_mosaic_bandsubset.tif 2 4 8 16